Skip to content

Add Tracking Domain

POST /offer/add_tracking_domain

Description URL Response Format Request Method Authentication
Adds a new tracking domain https://domain/api/offer/add_tracking_domain JSON POST HTTP headers

Parameters

Name Description Type Required
domain Domain including protocol (example: https://t.mydomain.com) string yes
redirect_domain URL destination for non tracking requests. This prevents the affiliate portal from displaying on this domain string no
template_protect if true, an error message will display instead of the affiliate portal for this domain boolean no

Example Request

POST

http://domain/api/offer/add_tracking_domain
domain=https://t.mydomain.com
template_protect=TRUE

Response:

{
  "result":"Success",
  "message":"Access modified"
}

Example Code

php

<?php 
$url = 'http://domain/api/offer/add_tracking_domain';
$curl = curl_init(); 

$headers = array( 
    'api-key: 44b5498dbcb481a0d00b404c0169af62', 
    'api-username: productsupport' 
); 

$data = Array(
  'domain' => 'https://t.mydomain.com',
  'template_protect' => TRUE,

);   

curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
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); 
?>