Convert Native Ad Item to Image
curl --request POST \
--url https://api.hakumedia.ai/v2/ad-items/native/{id}/to-image \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"media_group": 87,
"size": "300x250"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({media_group: 87, size: '300x250'})
};
fetch('https://api.hakumedia.ai/v2/ad-items/native/{id}/to-image', 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/{id}/to-image"
payload = {
"media_group": 87,
"size": "300x250"
}
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/native/{id}/to-image",
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([
'media_group' => 87,
'size' => '300x250'
]),
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;
}{
"data": {
"status": "success",
"task": 456,
"task_url": "/v2/scheduled-tasks/native-ad-to-image/456"
}
}Ad Items · Native
Convert Native Ad Item to Image
Schedules a task to convert a native ad item into an image creative. The generated image will be stored in the specified media group. Use the returned task URL to check the status of the conversion. Note: This endpoint requires the Native Ad to Image feature to be enabled.
POST
/
ad-items
/
native
/
{id}
/
to-image
Convert Native Ad Item to Image
curl --request POST \
--url https://api.hakumedia.ai/v2/ad-items/native/{id}/to-image \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"media_group": 87,
"size": "300x250"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({media_group: 87, size: '300x250'})
};
fetch('https://api.hakumedia.ai/v2/ad-items/native/{id}/to-image', 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/{id}/to-image"
payload = {
"media_group": 87,
"size": "300x250"
}
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/native/{id}/to-image",
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([
'media_group' => 87,
'size' => '300x250'
]),
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;
}{
"data": {
"status": "success",
"task": 456,
"task_url": "/v2/scheduled-tasks/native-ad-to-image/456"
}
}Autorizaciones
Cuerpo
application/json