Skip to content

Search Affiliate

GET affiliate/search

Description URL Response Format Request Method Authentication
Get info for an affiliate or multiple affiliates based on parameters https://domain/api/affiliate/search JSON GET HTTP headers

Parameters

Parameters can be sent as url encoded params. All parameters are optional so if none are entered, all affiliate information will be displayed.

Name Note Type Required
loginid integer no
password string no
email string yes
firstname string no
lastname string no
address string no
city string no
country string no
company string no
deleted string no
end string no
aim string no
icq string no
inhouse string no
join_count affiliate join transaction lookup < join_count string no
join_date string no
join_range Changes comparison with join_date (affiliate signup date > join_date) string no
login_date string no
login_ip string no
login_range string no
min_pay string no
name string no
trackingcode string no
orderby string no
pay_range string no
payvia_details string no
payvia_type_id string no
ratio affiliate hits/conversions < ratio string no
raw_clicks affiliate hits lookup < raw_clicks string no
continuity_count affiliate continuity lookup < continuity_count string no
refid string no
ref string no
void_count affiliate void lookup < void_count string no
sales_rep string no
start string no
state string no
stats_period string no
stats_end string no
stats_start string no
status string no
total_earned string no
total string no
type string no
unq_clicks affiliate unique click lookup < unq_clicks string no
url string no
return_payvia_info If passed as any non empty value, function will return affiliate payvia information within a sub array named "payvia_details" string no
return_referred_info If passed as any non empty value, function will return the referring affiliate chain for this account (parent accounts) within a sub array named "referred_details" string no
return_referring_info If passed as any non empty value, function will return all affiliate accounts referred by this affiliate (child accounts) within a sub array named "referring_details" string 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
$curl = curl_init();

$data = array(
    'username' => 'affiliate1',
);

$data_string = http_build_query($data);
$url = 'http://domain/api/affiliate/search?'.$data_string;

$headers = array(
    'api-key: 44b5498dbcb481a0d00b404c0169af62',
    'api-username: tmm1phrvezsbu'
);
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);
?>

python

This example requires pip and the request library which can be installed via pip by: 'pip install requests'

import requests
url = 'http://domain/api/affiliate/search'
params = {
        'username': 'affiliate1'
}
headers = {
     'api-key': '44b5498dbcb481a0d00b404c0169af62',
     'api-username': 'tmm1phrvezsbu'
}
res = requests.get(url, params=params, headers=headers)
print res.json()

node.js

This example requires npm and the request module which can be installed via npm by: 'npm install request'

var request = require('request');
var options = {
    url: 'http://domain/api/affiliate/search',
    method: 'GET',
    qs: {
        'username': 'affiliate1'
    },
    json: true,
    headers: {
        'api-key': '44b5498dbcb481a0d00b404c0169af62',
        'api-username': 'tmm1phrvezsbu'
    }
};
function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
    else{
        console.log(body);
    }
}
request(options, callback);
curl -X GET 'http://domain/api/affiliate/search?username=affiliate1' -H "api-key: 44b5498dbcb481a0d00b404c0169af62" -H "api-username: tmm1phrvezsbu"