# Click API

pro business

Click API is an app interface to run remotely Keitaro campaign.

# Click API clients

Official clients:

Third party:

# How it works

To get access to the API you need a campaign token.

Click API endpoint is:

/click_api/v3/

Example:

curl "https://tracker/click_api/v3?token=ebd928ea&log=1&info=1"
1

Response (JSON):

{
    "body": null,
    "contentType": "text/html; charset=utf-8",
    "headers": [
        "Location: https://domain.com/?data=&utm-campaign=aff1"
    ],
    "info": {
        "campaign_id": 2,
        "stream_id": 1117,
        "sub_id": "o2q6e42hs08jq",
        "type": "location",
        "url": "https://domain.com/?data=$keyword&utm-campaign=aff1"
    },
    "log": [
        "Processing campaign 2",
        "Referrer: ",
        "Source: ",
        "Keyword: ",
        "IP: 127.0.0.1",
        "UserAgent: HTTPie/0.6.0",
        "Language: ",
        "Is unique in campaign: no",
        "Checking stream #1282",
        "Filter  \"uniqueness\": allow",
        "Filter \"uniqueness\": rejected",
        "Checking stream #1343",
        "Filter \"region\": rejected",
        "Checking stream #1355",
        "Filter  \"limit\": allow",
        "Filter \"ip\": rejected",
        "Checking stream #1117",
        "Accepted by filters",
        "Stream #1117",
        "Send headers: Location: http://domain.com/?data=&utm-campaign=aff1",
        "[Profiler] 0.101 sec.  1 sql queries, 9MB (+7MB)"
    ],
    "uniqueness_cookie": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoie1wic3RyZWFtc1wiOntcIjExMTdcIjoxNDkwNzA1MTQyfSxcImNhbXBhaWduc1wiOntcIjJcIjoxNDkwNzA1MTQyfSxcInRpbWVcIjoxNDkwNzA1MTQyfSJ9._u5H9oOOdyp02VTnDN8VG47oLDoqRHHKyYI3ChxRqw8"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

# Request parameters

  • version. Version of Click API (current is 3).
  • ip — IP address of the IPv4 type.
  • user_agent. Raw browser user agent.
  • language. Language ISO code.
  • landing_id. Is needed to specify from what landing page was made request. Keitaro uses it for statistics.
  • uniqueness_cookie. Send cookies from the browser.
  • x_requested_with. Browsers x_requested_with header.
  • log. Use 1 to add traffic log to the response.
  • info. Use 1 to add additional information to the response.
  • force_redirect_offer. Use 1 to get redirect to the offer in response body. Leave empty to get _token to make Offer URL.

# Response

Response type json.

Field Value type Description
headers string[] Array of header responses
body string Body of the response (for example, the page text)
contentType string Response type (example, application/json; charset=utf-8)
uniqueness_cookie string Cookie that you must send in further requests to Click API
cookies_ttl int How many hours to store cookies on website side
log string[] Contents of the click processing log
info object Container with information by click
info.sub_id string
info.campaign_id int
info.stream_id int
info.landing_id int
info.offer_id int[]
info.token string
info.uniqueness array
info.uniqueness.campaign boolean
info.uniqueness.stream boolean
info.uniqueness.global boolean
info.is_bot boolean

# Click API FAQ

How to create Offer URL?

Create the link of the following format:

http://trackerdomain.com/?_lp=1&_token=info.token

You'll get info.token at your first API request.

How to get a subid?

An example:

$url = "https://domain_tracker/click_api/v3?token=szvkqdf1tk28n9pkwwk3t8tbv4v9&info=1";
$response = json_decode (file_get_contents ($url));
$subid = $response->info->sub_id;
var_dump($subid)
1
2
3
4