Get Single Link
GET /affiliate/get_single_link
Description | URL | Response Format | Request Method | Authentication |
---|---|---|---|---|
Gets the default affiliate tracking link for an offer. Optionally lets you specify an individual landing page. | https://domain/api/affiliate/get_single_link | JSON | GET | HTTP headers |
Parameters
Paremeters must be sent with the request body. The examples below show the parameters sent as x-www-form-urlencoded
Name | Description | Type | Required |
---|---|---|---|
loginid | affiliate to get link for | int | yes |
offerid | offer to get link for | int | no |
landing_pageid | landing page to get link for. Defaults to default lander for the offer. | int | no |
style | link style. Defaults to encoded. | string | no |
subaff | subaff value. Defaults to none. | string | no |
subaff2 | subaff2 value. Defaults to none. | string | no |
subaff3 | subaff3 value. Defaults to none. | string | no |
subaff4 | subaff4 value. Defaults to none. | string | no |
subaff5 | subaff5 value. Defaults to none. | string | no |
subids | comma separated list of subids. Defaults to none. | string | no |
_ocid | click id value. Defaults to none. | string | no |
code_only | returns only the code from the tracking link. Defaults to full url. | boolean | no |
Example Request
GET
https://domain/api/affiliate/get_single_link?loginid=2&offerid=1&subaff=test&_ocid={token}
Response:
{
"result":"Success",
"message":"http:\/\/example.com\/track\/Mi4yNjguMjc3LjMwNC4wLjAuMC4wLjAuNjIuMC4w?subaff=test&_ocid={token}"
}
Example Code
php
<?php
$url = 'http://domain/api/affiliate/get_single_link';
$curl = curl_init();
$headers = array(
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: productsupport'
);
$data = Array(
'loginid' => 2,
'offerid' => 1,
'subaff' => 'test',
'_ocid' => '{token}',
);
$data_string = http_build_query($data);
$url .= '?'.$data_string;
curl_setopt($curl, CURLOPT_GET, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$resp = curl_exec($curl);
//dumps an associative array representation of the json response
$output = json_decode($resp, true);
if($output !== NULL) {
//json was valid. Dump the decoded array
print_r($output);
}
else {
//invalid json, just dump the raw response
print_r($resp);
}
// Close request to clear up some resources
curl_close($curl);
?>