curl --request PUT \
--url https://api.hakumedia.ai/v2/campaigns/standard/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Standard Campaign"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Example Standard Campaign'})
};
fetch('https://api.hakumedia.ai/v2/campaigns/standard/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/campaigns/standard/{id}"
payload = { "name": "Example Standard Campaign" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/campaigns/standard/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Example Standard Campaign'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-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;
}{
"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"
]
}{
"http_status": 404,
"type": "resource_not_found_error",
"message": "Resource not found."
}Update a Standard Campaign
curl --request PUT \
--url https://api.hakumedia.ai/v2/campaigns/standard/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Standard Campaign"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Example Standard Campaign'})
};
fetch('https://api.hakumedia.ai/v2/campaigns/standard/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/campaigns/standard/{id}"
payload = { "name": "Example Standard Campaign" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/campaigns/standard/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Example Standard Campaign'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-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;
}{
"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"
]
}{
"http_status": 404,
"type": "resource_not_found_error",
"message": "Resource not found."
}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.
Path Parameters
Identifier of the resource.
Body
The name of the campaign. We recommend using a naming scheme that is descriptive, relevant, and consistent.
"Example Standard Campaign"
The advertiser identifier (ID).
633215
The tag to link this campaign to a roadblock, which allows you to exclusively serve ads from similar campaigns on all the zones on a web page. For example: tag1,tag2 (no spaces between values - the system trims them if there are any spaces entered).
NOTE: Only subscribers on the Standard tier and above can create roadblocks. If you don't have that feature enabled, you must set this field's value to null.
"tag1,tag2"
The ID of the contract associated with the campaign, if any. This is generated when you assign the campaign to a contract in the Haku interface.
NOTE: Contracts require subscribers to have the Contract Management add-on. If you don't have this add-on, you must set this field's value to null.
123
Whether to apply targeting on the campaign level (i.e. one targeting setup for all ad items in the campaign) or per ad item. Its value can either be "CAMPAIGN" or "AD_ITEM".
When set to "CAMPAIGN", the targeting options must be configured in the campaign placement.
When set to "AD_ITEM", the targeting options must be configured in the campaign assignment of each ad item.
NOTE: This setting cannot be changed once the campaign has been created. Further, you must have the Targeting add-on in your subscription to use targeting options, except for keyword targeting.
For more information, read Targeting overview.
"CAMPAIGN"
Whether to apply pacing and scheduling on the campaign level (i.e. one schedule setup for all ad items in the campaign) or per ad item. Possible values are "CAMPAIGN" or "AD_ITEM".
When set to "CAMPAIGN", the schedule must be referenced in the campaign placement.
When set to "AD_ITEM", the schedule must be referenced in the campaign assignment of each ad item.
NOTE: This setting cannot be changed once the campaign has been created.
For more information, read Pacing & scheduling.
"AD_ITEM"
An object containing any number of metadata keys and values. Keys and values must be strings.
{ "btf": "true", "mobile_only": "false" }
An object containing optional values for the daily, weekly, monthly and lifetime budget for the campaign.
{
"daily_budget": 10,
"weekly_budget": 100,
"monthly_budget": 1000,
"lifetime_budget": 10000
}
An array containing any number of trusted redirect domains. Values must always be valid domains, e.g. example.com, *.example.com, or custom protocols like tel:342682346.
NOTE: This only applies to campaigns which will be used in a zone with a 3rd party click macro implementation.
[
"example.com",
"*.example.com",
"tel:342682346"
]
Response
successful operation
The name of the campaign. We recommend using a naming scheme that is descriptive, relevant, and consistent.
"Example Standard Campaign"
A string denoting the current resource being requested or affected.
"standard_campaign"
The relative URL of the current resource being requested or affected.
"/v2/campaigns/standard/1234"
The current resource identifier (ID).
1234
The advertiser identifier (ID).
633215
The tag to link this campaign to a roadblock, which allows you to exclusively serve ads from similar campaigns on all the zones on a web page. For example: tag1,tag2 (no spaces between values - the system trims them if there are any spaces entered).
NOTE: Only subscribers on the Standard tier and above can create roadblocks. If you don't have that feature enabled, you must set this field's value to null.
"tag1,tag2"
The ID of the contract associated with the campaign, if any. This is generated when you assign the campaign to a contract in the Haku interface.
NOTE: Contracts require subscribers to have the Contract Management add-on. If you don't have this add-on, you must set this field's value to null.
123
Whether to apply targeting on the campaign level (i.e. one targeting setup for all ad items in the campaign) or per ad item. Its value can either be "CAMPAIGN" or "AD_ITEM".
When set to "CAMPAIGN", the targeting options must be configured in the campaign placement.
When set to "AD_ITEM", the targeting options must be configured in the campaign assignment of each ad item.
NOTE: This setting cannot be changed once the campaign has been created. Further, you must have the Targeting add-on in your subscription to use targeting options, except for keyword targeting.
For more information, read Targeting overview.
"CAMPAIGN"
Whether to apply pacing and scheduling on the campaign level (i.e. one schedule setup for all ad items in the campaign) or per ad item. Possible values are "CAMPAIGN" or "AD_ITEM".
When set to "CAMPAIGN", the schedule must be referenced in the campaign placement.
When set to "AD_ITEM", the schedule must be referenced in the campaign assignment of each ad item.
NOTE: This setting cannot be changed once the campaign has been created.
For more information, read Pacing & scheduling.
"AD_ITEM"
An object containing any number of metadata keys and values. Keys and values must be strings.
{ "btf": "true", "mobile_only": "false" }
An object containing optional values for the daily, weekly, monthly and lifetime budget for the campaign.
{
"daily_budget": 10,
"weekly_budget": 100,
"monthly_budget": 1000,
"lifetime_budget": 10000
}
An array containing any number of trusted redirect domains. Values must always be valid domains, e.g. example.com, *.example.com, or custom protocols like tel:342682346.
NOTE: This only applies to campaigns which will be used in a zone with a 3rd party click macro implementation.
[
"example.com",
"*.example.com",
"tel:342682346"
]