curl --request POST \
--url https://api.hakumedia.ai/v2/ad-items/catalog-item \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Catalog Item with ID",
"catalog_id": 123456,
"catalog_item_identifier": "123456789"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Catalog Item with ID',
catalog_id: 123456,
catalog_item_identifier: '123456789'
})
};
fetch('https://api.hakumedia.ai/v2/ad-items/catalog-item', 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/catalog-item"
payload = {
"name": "Catalog Item with ID",
"catalog_id": 123456,
"catalog_item_identifier": "123456789"
}
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/ad-items/catalog-item",
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([
'name' => 'Catalog Item with ID',
'catalog_id' => 123456,
'catalog_item_identifier' => '123456789'
]),
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": "Catalog Item with ID",
"catalog_id": 123456,
"catalog_item_identifier": "123456789",
"location": null,
"tracking_pixel": "https://example.com/",
"tracking_pixels": [
{
"id": 123,
"url": "<string>"
}
],
"metadata": [],
"object": "catalog_ad_item",
"self": "/v2/ad-items/catalog-item/14456",
"id": 14456,
"created_date": "2023-01-12 15:03:22",
"last_modified": "2023-01-19 10:59:22",
"deleted": false
}Create a Catalog Ad Item
Create a catalog ad item. The identifier_field field value must be unique within the catalog.
curl --request POST \
--url https://api.hakumedia.ai/v2/ad-items/catalog-item \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Catalog Item with ID",
"catalog_id": 123456,
"catalog_item_identifier": "123456789"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Catalog Item with ID',
catalog_id: 123456,
catalog_item_identifier: '123456789'
})
};
fetch('https://api.hakumedia.ai/v2/ad-items/catalog-item', 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/catalog-item"
payload = {
"name": "Catalog Item with ID",
"catalog_id": 123456,
"catalog_item_identifier": "123456789"
}
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/ad-items/catalog-item",
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([
'name' => 'Catalog Item with ID',
'catalog_id' => 123456,
'catalog_item_identifier' => '123456789'
]),
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": "Catalog Item with ID",
"catalog_id": 123456,
"catalog_item_identifier": "123456789",
"location": null,
"tracking_pixel": "https://example.com/",
"tracking_pixels": [
{
"id": 123,
"url": "<string>"
}
],
"metadata": [],
"object": "catalog_ad_item",
"self": "/v2/ad-items/catalog-item/14456",
"id": 14456,
"created_date": "2023-01-12 15:03:22",
"last_modified": "2023-01-19 10:59:22",
"deleted": false
}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
A string name for the ad item
255"Catalog Item with ID"
The id for the catalog
123456
The unique identifier for the item. The identifier_field field value must be unique within the catalog.
255"123456789"
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 indicates tracking pixel is not being used.
"https://url"
List of tracking pixels. An empty array indicates no tracking pixels are available.
Show child attributes
Show child attributes
An object containing any number of metadata fields and values. Fields and values must always be strings.
{ "mobile_only": "false" }
Response
successful operation
A string name for the ad item
255"Catalog Item with ID"
The id for the catalog
123456
The unique identifier for the item
255"123456789"
The destination URL to which the user will be redirected when they click on the ad item.
null
An optional third party tracking pixel served with the ad for monitoring impressions.
"https://example.com/"
List of tracking pixels. An empty array indicates no tracking pixels are available.
Show child attributes
Show child attributes
An object containing any number of metadata fields and values.
[]
A string denoting the current resource being requested or affected.
"catalog_ad_item"
The relative URL of the current resource being requested or affected.
"/v2/ad-items/catalog-item/14456"
The identifier for a catalog ad item (eg client SKU, or whichever other unique identifier used)
14456
The date and time when this ad item was created.
"2023-01-12 15:03:22"
The date and time the ad item was last modified.
"2023-01-19 10:59:22"
Whether the ad item has been deleted.
false