curl --request PUT \
--url https://api.hakumedia.ai/v2/ad-items/custom-html/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"location": "",
"tracking_pixel": "https://url.com",
"tracking_pixels": [
{
"id": 27419,
"url": "https://url1.com"
},
{
"id": 27420,
"url": "https://url2.com"
}
],
"metadata": {
"mobile_only": "false",
"TNR": "15"
},
"trusted_redirect_domains": [
"example.com",
"*.example.com",
"tel:342682346"
],
"custom_html": "<div> ... </div>",
"html_content_below": "<img />",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Ad Item',
height: 400,
width: 650,
location: '',
tracking_pixel: 'https://url.com',
tracking_pixels: [{id: 27419, url: 'https://url1.com'}, {id: 27420, url: 'https://url2.com'}],
metadata: {mobile_only: 'false', TNR: '15'},
trusted_redirect_domains: ['example.com', '*.example.com', 'tel:342682346'],
custom_html: '<div> ... </div>',
html_content_below: '<img />',
expand_horizontal_direction: 'left',
expand_vertical_direction: 'none'
})
};
fetch('https://api.hakumedia.ai/v2/ad-items/custom-html/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/ad-items/custom-html/{id}"
payload = {
"name": "Example Ad Item",
"height": 400,
"width": 650,
"location": "",
"tracking_pixel": "https://url.com",
"tracking_pixels": [
{
"id": 27419,
"url": "https://url1.com"
},
{
"id": 27420,
"url": "https://url2.com"
}
],
"metadata": {
"mobile_only": "false",
"TNR": "15"
},
"trusted_redirect_domains": ["example.com", "*.example.com", "tel:342682346"],
"custom_html": "<div> ... </div>",
"html_content_below": "<img />",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none"
}
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/ad-items/custom-html/{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 Ad Item',
'height' => 400,
'width' => 650,
'location' => '',
'tracking_pixel' => 'https://url.com',
'tracking_pixels' => [
[
'id' => 27419,
'url' => 'https://url1.com'
],
[
'id' => 27420,
'url' => 'https://url2.com'
]
],
'metadata' => [
'mobile_only' => 'false',
'TNR' => '15'
],
'trusted_redirect_domains' => [
'example.com',
'*.example.com',
'tel:342682346'
],
'custom_html' => '<div> ... </div>',
'html_content_below' => '<img />',
'expand_horizontal_direction' => 'left',
'expand_vertical_direction' => 'none'
]),
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 Ad Item",
"height": 400,
"width": 650,
"location": "",
"tracking_pixel": "https://url.com",
"tracking_pixels": [
{
"id": 27419,
"url": "https://url1.com"
},
{
"id": 27420,
"url": "https://url2.com"
}
],
"metadata": {
"mobile_only": "false",
"TNR": "15"
},
"trusted_redirect_domains": [
"example.com",
"*.example.com",
"tel:342682346"
],
"is_self_serve": false,
"custom_html": "<div> ... </div>",
"html_content_below": "<img />",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "custom_html_ad_item",
"self": "/v2/ad-items/custom-html/985124765",
"id": 985124765
}Update a Custom HTML Ad Item
curl --request PUT \
--url https://api.hakumedia.ai/v2/ad-items/custom-html/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"location": "",
"tracking_pixel": "https://url.com",
"tracking_pixels": [
{
"id": 27419,
"url": "https://url1.com"
},
{
"id": 27420,
"url": "https://url2.com"
}
],
"metadata": {
"mobile_only": "false",
"TNR": "15"
},
"trusted_redirect_domains": [
"example.com",
"*.example.com",
"tel:342682346"
],
"custom_html": "<div> ... </div>",
"html_content_below": "<img />",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Ad Item',
height: 400,
width: 650,
location: '',
tracking_pixel: 'https://url.com',
tracking_pixels: [{id: 27419, url: 'https://url1.com'}, {id: 27420, url: 'https://url2.com'}],
metadata: {mobile_only: 'false', TNR: '15'},
trusted_redirect_domains: ['example.com', '*.example.com', 'tel:342682346'],
custom_html: '<div> ... </div>',
html_content_below: '<img />',
expand_horizontal_direction: 'left',
expand_vertical_direction: 'none'
})
};
fetch('https://api.hakumedia.ai/v2/ad-items/custom-html/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/ad-items/custom-html/{id}"
payload = {
"name": "Example Ad Item",
"height": 400,
"width": 650,
"location": "",
"tracking_pixel": "https://url.com",
"tracking_pixels": [
{
"id": 27419,
"url": "https://url1.com"
},
{
"id": 27420,
"url": "https://url2.com"
}
],
"metadata": {
"mobile_only": "false",
"TNR": "15"
},
"trusted_redirect_domains": ["example.com", "*.example.com", "tel:342682346"],
"custom_html": "<div> ... </div>",
"html_content_below": "<img />",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none"
}
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/ad-items/custom-html/{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 Ad Item',
'height' => 400,
'width' => 650,
'location' => '',
'tracking_pixel' => 'https://url.com',
'tracking_pixels' => [
[
'id' => 27419,
'url' => 'https://url1.com'
],
[
'id' => 27420,
'url' => 'https://url2.com'
]
],
'metadata' => [
'mobile_only' => 'false',
'TNR' => '15'
],
'trusted_redirect_domains' => [
'example.com',
'*.example.com',
'tel:342682346'
],
'custom_html' => '<div> ... </div>',
'html_content_below' => '<img />',
'expand_horizontal_direction' => 'left',
'expand_vertical_direction' => 'none'
]),
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 Ad Item",
"height": 400,
"width": 650,
"location": "",
"tracking_pixel": "https://url.com",
"tracking_pixels": [
{
"id": 27419,
"url": "https://url1.com"
},
{
"id": 27420,
"url": "https://url2.com"
}
],
"metadata": {
"mobile_only": "false",
"TNR": "15"
},
"trusted_redirect_domains": [
"example.com",
"*.example.com",
"tel:342682346"
],
"is_self_serve": false,
"custom_html": "<div> ... </div>",
"html_content_below": "<img />",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "custom_html_ad_item",
"self": "/v2/ad-items/custom-html/985124765",
"id": 985124765
}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 ad item you'd like to update.
Body
The name of the ad item. We recommend using a naming convention that is descriptive, consistent, and clear.
"Example Ad Item"
The height of the ad item in pixels. Defaults to 0 when no height given. If width is set to a value greater than 0, a height must also be set to a non-zero value. A width and height both set to 0 signify a "dynamic ad". Read more about dynamic ads.
400
The width of the ad item in pixels. Defaults to 0 when no width given. If height is set to a value greater than 0, a width must also be set to a non-zero value. A width and height both set to 0 signify a "dynamic ad". Read more about dynamic ads.
650
The destination URL to which the user will be redirected when they click on the ad item. A null value denotes no redirection.
""
An optional third party tracking pixel served with the ad for monitoring impressions. A null value means no tracking pixel was added. Use tracking_pixels if you want to add multiple tracking pixels.
NOTE: Essentials subscribers do not have access to third-party pixel tracking and therefore must set this field's value to null.
"https://url.com"
List of tracking pixels. An empty array means that no tracking pixels were added.
To create a tracking pixel, enter an object that only has the url field. An id for the new tracking pixel will be sent in the response.
To update a tracking pixel, enter an object with the tracking pixel's id and the new url for the tracking pixel.
To delete a tracking pixel, enter an object with the tracking pixel id and set url to null.
Show child attributes
Show child attributes
[ { "id": 27419, "url": "https://url1.com" }, { "id": 27420, "url": "https://url2.com" } ]
An object containing any number of metadata keys and values. Keys and values must be strings.
{ "mobile_only": "false", "TNR": "15" }
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 ad items which will be used in a zone with a 3rd party click macro implementation.
[ "example.com", "*.example.com", "tel:342682346" ]
The HTML content of the ad item.
"<div> ... </div>"
The HTML content that will appear below the ad item.
"<img />"
Whether to allow the rich media ad item to expand in the horizontal direction. The value can be "none", "left", or "right". Defaults to "none".
"left"
Whether to allow the rich media ad item to expand in the vertical direction. The value can be "none", "up", or "down". Defaults to "none".
"none"
Response
successful operation
The name of the ad item. We recommend using a naming convention that is descriptive, consistent, and clear.
"Example Ad Item"
The height of the ad item in pixels. Defaults to 0 when no height given. If width is set to a value greater than 0, a height must also be set to a non-zero value. A width and height both set to 0 signify a "dynamic ad". Read more about dynamic ads.
400
The width of the ad item in pixels. Defaults to 0 when no width given. If height is set to a value greater than 0, a width must also be set to a non-zero value. A width and height both set to 0 signify a "dynamic ad". Read more about dynamic ads.
650
The destination URL to which the user will be redirected when they click on the ad item. A null value denotes no redirection.
""
An optional third party tracking pixel served with the ad for monitoring impressions. A null value means no tracking pixel was added. Use tracking_pixels if you want to add multiple tracking pixels.
NOTE: Essentials subscribers do not have access to third-party pixel tracking and therefore must set this field's value to null.
"https://url.com"
List of tracking pixels. An empty array means that no tracking pixels were added.
To create a tracking pixel, enter an object that only has the url field. An id for the new tracking pixel will be sent in the response.
To update a tracking pixel, enter an object with the tracking pixel's id and the new url for the tracking pixel.
To delete a tracking pixel, enter an object with the tracking pixel id and set url to null.
Show child attributes
Show child attributes
[ { "id": 27419, "url": "https://url1.com" }, { "id": 27420, "url": "https://url2.com" } ]
An object containing any number of metadata keys and values. Keys and values must be strings.
{ "mobile_only": "false", "TNR": "15" }
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 ad items which will be used in a zone with a 3rd party click macro implementation.
[ "example.com", "*.example.com", "tel:342682346" ]
Whether or not this ad item is from Self-Serve.
false
The HTML content of the ad item.
"<div> ... </div>"
The HTML content that will appear below the ad item.
"<img />"
Whether to allow the rich media ad item to expand in the horizontal direction. The value can be "none", "left", or "right". Defaults to "none".
"left"
Whether to allow the rich media ad item to expand in the vertical direction. The value can be "none", "up", or "down". Defaults to "none".
"none"
The date and time when this ad item was created.
"2019-04-26 14:55:31"
The date and time the ad item was last modified.
"2019-04-26 14:55:39"
A string denoting the current resource being requested or affected.
"custom_html_ad_item"
The relative URL of the current resource being requested or affected.
"/v2/ad-items/custom-html/985124765"
The current resource identifier (ID).
985124765