Click API Benefits

The Click API functionality allows you to drive traffic directly to your advertiser's website without unnecessary redirects. As a result, landing pages load faster for the end users. Also, the Click API allows you to specify direct links to the advertisers' website in advertising creatives.

How to use the Click API?

Not all offers support the Click API. If this option is enabled for the offer, then a special Click API icon will be present in the campaign card.



General scheme of the Click API

An affiliate should make a request to the Click API URL, the request will return a unique {click_id} value.
The click id value should be inserted into the advertiser's website direct link (Traffic URL traffic).



Click API URL example: https://tracker.hoqu.com/api/click/create?secure_key=4497bf7b-7956-4f31-8d70-2e72cfc07572&offer_id=5306&campaign_id=816&promo_id=522&user_useragent=123&user_ip=0.0.0.0

Server response example:

{
"data": {
"click_id": "be4991fe-ea59-5a5e-9931-6240eb0c8775",
"params": {
"click_id": "be4991fe-ea59-5a5e-9931-6240eb0c8775"
},
"exists": true,
"session_id": "f5f55912-4007-5861-85e2-5b6a6e9c3941"
},
"status": "success"
}


The be4991fe-ea59-5a5e-9931-6240eb0c8775 value is a сlick id.

Next, insert the obtained {click_id} value into the link in the Traffic URL field instead of the {click_id} macros.

URL example:
https://advertisers-web-site.com/?click_id=be4991fe-ea59-5a5e-9931-6240eb0c8775

IMPORTANT! The сlick id value, obtained as a result of a request to the Сlick API URL, should be inserted into the advertiser's website direct link address for traffic in the URL. Otherwise, the conversions will not be recorded in HOQU.

The following required parameters must be passed in the request for the Click API URL:

secure_key - secret key. Example: 00000000-0000-0000-0000-000000000000.
offer_id - Offer ID. Example: 123.
campaign_id - Campaign ID. Example: 456.
promo_id - Promo ID. Example: 789.
user_ip - User IP. Example: 0.0.0.0.
user_useragent - User’s web browser data. Example: Mazila Chrome\\/7.7.7.

You can also pass the following optional parameters in the Click API URL request:

user_referrer - User’s referrer URL. Example: https://www.google.com/.
utm_source - Traffic source. Example: yandex_direct.
subid1, subid2, subid3 - Optional parameters.

Server Response

200 - Success
{
"status": "success",
"code": 200
}

202 - Offer is inactive
{
"reason": "offer_inactive",
"status": "trafficback",
"code": 202
}

202 - Campaign is inactive
{
"reason": "campaign_inactive",
"status": "trafficback",
"code": 202
}

202 - Targeting mismatch: the user's IP address or device does not match the targeting conditions of the offer. In this case, you need to send traffic to the Trafficback URL.
{
"reason": "targeting",
"status": "trafficback",
"code": 202
}

202 - Cap reached: the offer conversions capping has been reached
{
"reason": "overcap",
"status": "trafficback",
"code": 202
}

400 - The value in the request.offer_id field is invalid: the value of the offer_id, campaign_id, promo_id fields is incorrect
{
"message": "Field request.offer_id is not valid",
"status": "error",
"code": 400
}

403 - Access denied
{
"message": "Access denied",
"status": "error",
"code": 403
}

403 - Click API is disabled for this offer
{
"message": "Click api disabled for this offer",
"status": "error",
"code": 403
}

500 - Internal server error
{
"message": "Something bad happened on the server side, administration notified",
"status": "error",
"code": 500
}


Code example
$curl = curl_init();
curl_setopt_array($curl, array(
> 'https://tracker.domain/api/click/create?secure_key=00000000-0000-0000-0000-000000000000&offer_id=123&campaign_id=456&promo_id=789&user_ip=0.0.0.0&user_useragent=Mazila%20Chrome/7.7.7&user_referrer=https://vk.com&utm_source=&utm_medium=&utm_campaign=&utm_term=&utm_content=&subid1=&subid2=&subid3=&subid4=&subid5=&subid6=',
> true,
> 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo json_decode($response);
>


Additional information

Click API URL requests are cached within one offer for 300 seconds for one IP and User agent within one campaign.
Was this article helpful?
Cancel
Thank you!