Get Links
GET /affiliate/get_links
Description | URL | Response Format | Request Method | Authentication |
---|---|---|---|---|
Gets all tracking links for an affiliate. Optionally lets you limit to a specific offer or landing page. | https://domain/api/affiliate/get_links | 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 | optional 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 |
get_countries | return the authorized and unauthorized countries for each link. | boolean | no |
get_commission | return the commission string for each link | boolean | no |
get_hidden | 0 to return landing pages that are not hidden, 1 only hidden landing pages, 2 all. If not sent, will behave as if you passed 0 for only landing pages that are not hidden. | int | no |
get_hidden_offers | Optional - 0 to return offers that are not hidden, 1 only hidden offers, 2 all offers. If not sent, will behave as if you passed 2 for all offers. | int | no |
get_advertiser | Optional - return the advertiser id and username for each link | boolean | no |
Example Request
GET
http://domain/api/affiliate/search
Response:
{
"3": {
"loginid": "3",
"username": "affiliate1",
"password": "$6$4Arjzx0l$KexJXqDqIWBtasD54qQh5Tknnj2mm.m3D9ULyAef.GvYdxMO3w3ERStyTzy.VXXPRNsykYLfjQNt8APX0x4Wq.",
"deleted": "0",
"type": "100",
"skinid": "102",
"payvia_type_id": "1",
"status": "0",
"pass_hash": "55718788453dfec428c9fb3.27539735",
"join_date": "1402587397",
"inhouse": "0",
"api_key": "",
"tmmid": "0",
"origin": "0",
"language": "en",
"rss_pass_code": "145b3ce7614671d0a9ebe81f87ac275d",
"payout_period_id": "0",
"firstname": "Test",
"lastname": "Testakovsky",
"email": "hello@trackfinity.com",
"date_posted": "1402587397",
"join_ip": "168430159",
"last_login": "1407183950",
"last_login_ip": "168430236",
"reviewed": "1",
"minimum_payout": "50",
"bonus": "0",
"bonus_used": "0",
"verify": "",
"reason": "",
"unencoded": "0",
"startpage": "internal.php",
"rep_baseline": "0",
"company": "Test Company",
"url": "http:\/\/this.is\/test",
"tel": "",
"icq": "",
"aim": "",
"msn": "",
"address1": "666 Lemmy St",
"address2": null,
"city": "Heck",
"state": "NJ",
"country": "US",
"zip_code": "66666",
"tax_id_or_ssn": "",
"invoicer": "0",
"req_docs": "1",
"w9": "1",
"mailok": "1",
"trust_level": "0",
"new_notification": "0",
"latest_news": "1403790938",
"default_campaign": "0",
"default_program": "1",
"default_site": "0",
"pv_instant": "0",
"payout_approval": "0",
"access_preset": "0",
"custom1": "0",
"custom2": "0",
"custom3": "0",
"custom4": "0",
"custom5": "0",
"avatar_ext": "",
"remote_access": "0",
"remote_payment": "0",
"remote_adtool": "0",
"allow_subscription_passthrough": "0",
"allow_option_force": "0",
"status_nice": null,
"payvia_details": [ ]
}
}
Example Code
php
<?php
$url = 'http://domain/api/affiliate/get_links';
$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);
?>