Generate Bulk Zone Tags
curl --request POST \
--url https://api.hakumedia.ai/v2/zones/standard/tags/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"zones": [
{
"zone_id": 12345,
"quantity": 3,
"type": "async",
"protocol": "https",
"click": "https://example.com/click",
"fallback": false,
"extra": "?fromHaku=1",
"ortb_version": "2.5",
"consent_management": true,
"force_height": true,
"css_classes": "ad-class",
"custom_div_id": "my_zone_1"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
zones: [
{
zone_id: 12345,
quantity: 3,
type: 'async',
protocol: 'https',
click: 'https://example.com/click',
fallback: false,
extra: '?fromHaku=1',
ortb_version: '2.5',
consent_management: true,
force_height: true,
css_classes: 'ad-class',
custom_div_id: 'my_zone_1'
}
]
})
};
fetch('https://api.hakumedia.ai/v2/zones/standard/tags/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/zones/standard/tags/bulk"
payload = { "zones": [
{
"zone_id": 12345,
"quantity": 3,
"type": "async",
"protocol": "https",
"click": "https://example.com/click",
"fallback": False,
"extra": "?fromHaku=1",
"ortb_version": "2.5",
"consent_management": True,
"force_height": True,
"css_classes": "ad-class",
"custom_div_id": "my_zone_1"
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/zones/standard/tags/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'zones' => [
[
'zone_id' => 12345,
'quantity' => 3,
'type' => 'async',
'protocol' => 'https',
'click' => 'https://example.com/click',
'fallback' => false,
'extra' => '?fromHaku=1',
'ortb_version' => '2.5',
'consent_management' => true,
'force_height' => true,
'css_classes' => 'ad-class',
'custom_div_id' => 'my_zone_1'
]
]
]),
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;
}{
"object": "bulk_zone_tags",
"data": {
"head_tag": "<script type='text/javascript'>...",
"zone_tags": [
"<div id='placement_xxx'></div>"
]
}
}{
"http_status": 400,
"type": "invalid_request_parameters_error",
"message": "One or more of the specified fields was invalid. See the 'parameters' array for a full list of errors.",
"parameters": [
{
"field": "field_name",
"type": "invalid_value",
"message": "The field 'field_name' contains an invalid value."
}
]
}Zones · Standard
Generate Bulk Zone Tags
Returns a single head_tag script and an array of zone_tags for multiple standard zones in one request. Use this to embed many zone tags (e.g. multiple ad slots) with one API call. Each zone may appear only once in the request; use the quantity parameter for multiple instances of the same zone. All zones must use the same protocol.
POST
/
zones
/
standard
/
tags
/
bulk
Generate Bulk Zone Tags
curl --request POST \
--url https://api.hakumedia.ai/v2/zones/standard/tags/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"zones": [
{
"zone_id": 12345,
"quantity": 3,
"type": "async",
"protocol": "https",
"click": "https://example.com/click",
"fallback": false,
"extra": "?fromHaku=1",
"ortb_version": "2.5",
"consent_management": true,
"force_height": true,
"css_classes": "ad-class",
"custom_div_id": "my_zone_1"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
zones: [
{
zone_id: 12345,
quantity: 3,
type: 'async',
protocol: 'https',
click: 'https://example.com/click',
fallback: false,
extra: '?fromHaku=1',
ortb_version: '2.5',
consent_management: true,
force_height: true,
css_classes: 'ad-class',
custom_div_id: 'my_zone_1'
}
]
})
};
fetch('https://api.hakumedia.ai/v2/zones/standard/tags/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/zones/standard/tags/bulk"
payload = { "zones": [
{
"zone_id": 12345,
"quantity": 3,
"type": "async",
"protocol": "https",
"click": "https://example.com/click",
"fallback": False,
"extra": "?fromHaku=1",
"ortb_version": "2.5",
"consent_management": True,
"force_height": True,
"css_classes": "ad-class",
"custom_div_id": "my_zone_1"
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/zones/standard/tags/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'zones' => [
[
'zone_id' => 12345,
'quantity' => 3,
'type' => 'async',
'protocol' => 'https',
'click' => 'https://example.com/click',
'fallback' => false,
'extra' => '?fromHaku=1',
'ortb_version' => '2.5',
'consent_management' => true,
'force_height' => true,
'css_classes' => 'ad-class',
'custom_div_id' => 'my_zone_1'
]
]
]),
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;
}{
"object": "bulk_zone_tags",
"data": {
"head_tag": "<script type='text/javascript'>...",
"zone_tags": [
"<div id='placement_xxx'></div>"
]
}
}{
"http_status": 400,
"type": "invalid_request_parameters_error",
"message": "One or more of the specified fields was invalid. See the 'parameters' array for a full list of errors.",
"parameters": [
{
"field": "field_name",
"type": "invalid_value",
"message": "The field 'field_name' contains an invalid value."
}
]
}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.
Body
application/json
Array of zone entries. Each zone_id must appear only once; use quantity for multiple instances.
Show child attributes
Show child attributes