Create a Catalog Ad Item
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
}Ad Items · Catalog Item
Create a Catalog Ad Item
Create a catalog ad item. The identifier_field field value must be unique within the catalog.
POST
/
ad-items
/
catalog-item
Create a Catalog Ad Item
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
}Autorizaciones
Cuerpo
application/json
Respuesta
default - application/json
successful operation