You can get the report on clicks that users made after they followed affiliate links on your platform.
This endpoint returns the list of click items, where each item contains information about clicks retrieved according to the specified parameters.
You can get the detailed report for the specified platform or for all platforms in your account.
If your platform has been disconnected from a program, you can still receive reports for it.
You can test this API endpoint and inspect the possible responses using Swagger UI.
Request
URL: https://api.takeads.com/v1/api/stats/click
Method: GET
Request headers
Header | Value | Description |
Authorization | Bearer <PublicKey> |
String of alphanumeric characters with Bearer as prefix, used to authenticate and authorize your API requests. To learn how to get your Public key, refer to the Authorization article. |
Query parameters
You can use query parameters to get specific reports on clicks or paginate the response.
This endpoint has no required parameters.
To get information about clicks performed within a certain period, use one of the following: days
parameter, or date
parameter, or a pair of dateFrom
and dateTo
parameters.
- If
days
parameter is specified —date
,dateFrom
anddateTo
parameters are ignored.
- If
days
parameter is not specified anddate
parameter is specified —dateFrom
anddateTo
parameters are ignored.
The specified period cannot exceed 120 days. If you don’t specify the period, information for the past 7 seven days is returned.
Use offset
and limit
parameters to paginate the response.
The following table describes query parameters that you can use in the request.
Property | Type | Description |
dateFrom |
string |
Starting point of the reporting period. This parameter can't be used without the ending point of the filtering period — Example: 2021-08-03 |
dateTo |
string |
Ending point of the reporting period. This parameter can't be used without the starting point of the filtering period — Example: 2021-08-04 |
date |
string |
Exact reporting date. Example: 2021-08-03 |
days |
integer |
Number of days in the reporting period. Defaults to 7. Example: 3 The starting date of the reporting period can be defined by the current date minus the number of |
programId |
string |
ID (UUIDv4) of the program you want to get the report for. Example: f527f086-3c67-4c03-8dd5-556d14106dd2 |
subId |
string |
SubId of the deeplink you want to get the report for. Example: abc_123-2 |
adspaceId |
string |
ID (UUIDv4) of the platform you want to get the report for. Example: 603f4ef6-ec4f-4f34-827c-9a66ca6920a4 |
offset |
integer |
If specified, the list of clicks starting with the |
limit |
integer |
The maximum number of clicks that may be returned for a single request. The default value is 500. The maximum value is 500. |
Request examples
-
curl --request GET \
--url 'https://api.takeads.com/v1/api/stats/click?dateFrom=2021-08-03&dateTo=2021-08-04&subId=test&adspaceId=fb9868e4-b7e3-4d2f-957e-7ed7e0f1e87f&programId=c126a15d-ebb3-4ed8-b5d1-a239ecd52e0d01&limit=100&offset=500' \ --header 'Authorization: Bearer <Public Key>'\ --header 'Content-Type: application/json'
-
fetch("https://api.takeads.com/v1/api/stats/click?dateFrom=2021-08-03&dateTo=2021-08-04&subId=test&adspaceId=fb9868e4-b7e3-4d2f-957e-7ed7e0f1e87f&programId=c126a15d-ebb3-4ed8-b5d1-a239ecd52e0d01&limit=100&offset=500", {
"method": "GET",
"headers": {
"Authorization": "Bearer <Public Key>",
"Content-Type": "application/json"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
}); -
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6110",
CURLOPT_URL => "https://api.takeads.com/v1/api/stats/click?dateFrom=2021-08-03&dateTo=2021-08-04&subId=test&adspaceId=fb9868e4-b7e3-4d2f-957e-7ed7e0f1e87f&programId=c126a15d-ebb3-4ed8-b5d1-a239ecd52e0d01&limit=100&offset=500",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <Public Key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
} -
import http.client
conn = http.client.HTTPSConnection("https://api.takeads.com")
payload = ""
headers = {
'Authorization': "Bearer <Public Key>",
'Content-Type': "application/json"
}
conn.request("GET", "/v1/api/stats/click?dateFrom=2021-08-03&dateTo=2021-08-04&subId=test&adspaceId=fb9868e4-b7e3-4d2f-957e-7ed7e0f1e87f&programId=c126a15d-ebb3-4ed8-b5d1-a239ecd52e0d01&limit=100&offset=500", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response
If the request was successfully processed by the server, the HTTP response with 200 status code and the list of available click items is returned.
The returned click items are sorted by the updatedAt
value in the descending order. If the updatedAt
value is the same for a number of items, they are filtered by their id
s in the ascending order.
The response payload is a JSON object that contains a meta
object with metadata and a data
array with the retrieved click items. Each item of the array is an object with the details about the clicks retrieved according to request.
The following table describes the response properties.
Property | Type | Description |
offset |
integer |
If specified, the list of click items starting with the |
limit |
integer |
The maximum number of click items that may be returned for a single request. The default value is 500. The Maximum value is 500. |
total |
integer |
Total number of click items corresponding to the specified parameters. |
id |
number / null |
Click item ID. |
adspaceId |
string |
ID (UUIDv4) of the platform you received the report for. |
adspaceName |
string |
Name of the platform. |
programId |
string |
ID (UUIDv4) of the program you received the report for. |
programName |
string |
Name of the program. |
subId |
string / null |
SubID of the deeplink you received the report for.
|
date |
string |
Date when clicks in the click item were performed. Example: 2021-08-03 |
count |
number |
Number of clicks in the click item. |
productId |
string |
ID of the Takeads product. Possible values: |
updatedAt |
string |
Timestamp ($ISO 8601) when information about clicks in the click item was last updated in the statistics. Example: 2021-08-03T19:53:15.816Z |
Example value
{
{
"meta": {
"offset": 100,
"limit": 500,
"total": 3128
},
"data": [
{
"id": 554,
"adspaceId": "4b782606-a17f-427f-9acb-e42ba1397713",
"adspaceName": "My Adspace",
"programId": "9b98db20-5cfa-4bf9-97b6-b56a60a0c373",
"programName": "My Program WW",
"subId": "abc_123-2",
"date": "2022-08-03",
"count": 100,
"productId": "MONETIZE_API",
"updatedAt": "2021-08-03T19:53:15.816Z"
}
]
}
To view possible error responses, refer to the Error responses article.