curl --request GET \
--url https://api.hakumedia.ai/v2/campaigns \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.hakumedia.ai/v2/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/campaigns"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/campaigns",
"data": [
{
"name": "Example Standard Campaign",
"object": "standard_campaign",
"self": "/v2/campaigns/standard/1234",
"id": 1234,
"advertiser": 633215,
"roadblock_tags": "tag1,tag2",
"contract": 123,
"targeting_source": "CAMPAIGN",
"scheduling_source": "AD_ITEM",
"metadata": {
"btf": "true",
"mobile_only": "false"
},
"budget": {
"daily_budget": 10,
"weekly_budget": 100,
"monthly_budget": 1000,
"lifetime_budget": 10000
},
"trusted_redirect_domains": [
"example.com",
"*.example.com",
"tel:342682346"
]
}
]
}Get a List of All Campaigns
You can use the fields query parameter to restrict the fields to be retrieved.
curl --request GET \
--url https://api.hakumedia.ai/v2/campaigns \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.hakumedia.ai/v2/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/campaigns"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/campaigns",
"data": [
{
"name": "Example Standard Campaign",
"object": "standard_campaign",
"self": "/v2/campaigns/standard/1234",
"id": 1234,
"advertiser": 633215,
"roadblock_tags": "tag1,tag2",
"contract": 123,
"targeting_source": "CAMPAIGN",
"scheduling_source": "AD_ITEM",
"metadata": {
"btf": "true",
"mobile_only": "false"
},
"budget": {
"daily_budget": 10,
"weekly_budget": 100,
"monthly_budget": 1000,
"lifetime_budget": 10000
},
"trusted_redirect_domains": [
"example.com",
"*.example.com",
"tel:342682346"
]
}
]
}Authorizations
API key en el header Authorization: Basic TU_API_KEY. La key va tal cual, sin codificar en base64. Las credenciales se entregan al comenzar la integración.
Query Parameters
The number of objects returned in the response, sometimes called "take". The max value is 100.
The position to start the retrieval of objects, sometimes called "skip".
A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (For example: "1134, 1153, 1138, 1176")
Restrict the fields you wish to retrieve by listing the desired fields formatted as a comma-separated list. Fields like "object", "self", and "id" are always returned.
When set to true, only campaigns with an existing campaign assignment will be returned.
Response
successful operation
For list resources, the value of 'object' will always be 'list'.
"list"
True if there are more data beyond the offset and limit.
false
The number of resources to return. Sometimes called 'take'.
10
The number of resources in sequence to ignore, sometimes called 'skip'.
0
The URL of the current resource list.
"/v2/campaigns"
The campaigns in this list
Show child attributes
Show child attributes