Update a Companion Product for a Native Ad Item
curl --request PUT \
--url https://api.hakumedia.ai/v2/ad-items/native/{ad_item_id}/companions/products/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"catalog": 10001,
"product_identifier": "SKU-1001"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({catalog: 10001, product_identifier: 'SKU-1001'})
};
fetch('https://api.hakumedia.ai/v2/ad-items/native/{ad_item_id}/companions/products/{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/native/{ad_item_id}/companions/products/{id}"
payload = {
"catalog": 10001,
"product_identifier": "SKU-1001"
}
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/native/{ad_item_id}/companions/products/{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([
'catalog' => 10001,
'product_identifier' => 'SKU-1001'
]),
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": "ad_item_companion_product",
"self": "/v2/ad-items/image/1234/companions/products/5678",
"id": 1234,
"catalog": 10001,
"product_identifier": "SKU-1001"
}{
"http_status": 404,
"type": "resource_not_found_error",
"message": "Resource not found."
}Ad Items · Companion Products
Update a Companion Product for a Native Ad Item
PUT
/
ad-items
/
native
/
{ad_item_id}
/
companions
/
products
/
{id}
Update a Companion Product for a Native Ad Item
curl --request PUT \
--url https://api.hakumedia.ai/v2/ad-items/native/{ad_item_id}/companions/products/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"catalog": 10001,
"product_identifier": "SKU-1001"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({catalog: 10001, product_identifier: 'SKU-1001'})
};
fetch('https://api.hakumedia.ai/v2/ad-items/native/{ad_item_id}/companions/products/{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/native/{ad_item_id}/companions/products/{id}"
payload = {
"catalog": 10001,
"product_identifier": "SKU-1001"
}
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/native/{ad_item_id}/companions/products/{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([
'catalog' => 10001,
'product_identifier' => 'SKU-1001'
]),
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": "ad_item_companion_product",
"self": "/v2/ad-items/image/1234/companions/products/5678",
"id": 1234,
"catalog": 10001,
"product_identifier": "SKU-1001"
}{
"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 ad item.
Identifier of the companion product.
Body
application/json
Response
successful operation
A string denoting the current resource being requested or affected.
Example:
"ad_item_companion_product"
The relative URL of the current resource being requested or affected.
Example:
"/v2/ad-items/image/1234/companions/products/5678"
The current resource identifier (ID).
Example:
1234
The ID of the product DB catalog.
Example:
10001
The product identifier (SKU) within the catalog.
Example:
"SKU-1001"