curl --request GET \
--url https://api.hakumedia.ai/v2/templates/native/{id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.hakumedia.ai/v2/templates/native/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/templates/native/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/templates/native/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"name": "Product List Native Template",
"raw_html": "<div class='[%ad-color%]'><h1>[%title%]</h1><a href='[%button-link%]'>Purchase for Only [%price%]!</a></div>",
"variables": [
{
"id": 6885,
"name": "Title",
"placeholder": "[%title%]",
"type": "text",
"max_length": 50,
"dropdown_values": null,
"optional": true
},
{
"id": 6886,
"name": "Price",
"placeholder": "[%price%]",
"type": "number",
"max_length": null,
"dropdown_values": null,
"optional": false
},
{
"id": 6887,
"name": "Button Link",
"placeholder": "[%button-link%]",
"type": "url",
"max_length": null,
"dropdown_values": null,
"optional": false
},
{
"id": 6888,
"name": "Ad Color",
"placeholder": "[%ad-color%]",
"type": "dropdown",
"max_length": null,
"dropdown_values": "red,green,blue,orange",
"optional": true
}
],
"object": "native_template",
"self": "/v2/templates/native/1234",
"id": 1234,
"latest_version_id": 522361,
"references": [
55213,
66514,
64572
],
"outdated_references": []
}{
"http_status": 404,
"type": "resource_not_found_error",
"message": "Resource not found."
}Get a Single Native Template
curl --request GET \
--url https://api.hakumedia.ai/v2/templates/native/{id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.hakumedia.ai/v2/templates/native/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/templates/native/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/templates/native/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"name": "Product List Native Template",
"raw_html": "<div class='[%ad-color%]'><h1>[%title%]</h1><a href='[%button-link%]'>Purchase for Only [%price%]!</a></div>",
"variables": [
{
"id": 6885,
"name": "Title",
"placeholder": "[%title%]",
"type": "text",
"max_length": 50,
"dropdown_values": null,
"optional": true
},
{
"id": 6886,
"name": "Price",
"placeholder": "[%price%]",
"type": "number",
"max_length": null,
"dropdown_values": null,
"optional": false
},
{
"id": 6887,
"name": "Button Link",
"placeholder": "[%button-link%]",
"type": "url",
"max_length": null,
"dropdown_values": null,
"optional": false
},
{
"id": 6888,
"name": "Ad Color",
"placeholder": "[%ad-color%]",
"type": "dropdown",
"max_length": null,
"dropdown_values": "red,green,blue,orange",
"optional": true
}
],
"object": "native_template",
"self": "/v2/templates/native/1234",
"id": 1234,
"latest_version_id": 522361,
"references": [
55213,
66514,
64572
],
"outdated_references": []
}{
"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 resource.
Query Parameters
Restrict the fields you wish to retrieve by listing the desired fields formatted as a comma-separated list. Fields like "object", "self", and "id" are always returned.
Response
successful operation
The name of the native template. We recommend using a naming scheme that is descriptive, relevant, and consistent.
"Product List Native Template"
The HTML that will be served as an ad. This HTML should include the variable placeholder values that will be replaced when the template is used to create a native ad.
"<div class='[%ad-color%]'><h1>[%title%]</h1><a href='[%button-link%]'>Purchase for Only [%price%]!</a></div>"
The variables to be replaced in the raw_html when the template is used to create a native ad.
Show child attributes
Show child attributes
[
{
"id": 6885,
"name": "Title",
"placeholder": "[%title%]",
"type": "text",
"max_length": 50,
"dropdown_values": null,
"optional": true
},
{
"id": 6886,
"name": "Price",
"placeholder": "[%price%]",
"type": "number",
"max_length": null,
"dropdown_values": null,
"optional": false
},
{
"id": 6887,
"name": "Button Link",
"placeholder": "[%button-link%]",
"type": "url",
"max_length": null,
"dropdown_values": null,
"optional": false
},
{
"id": 6888,
"name": "Ad Color",
"placeholder": "[%ad-color%]",
"type": "dropdown",
"max_length": null,
"dropdown_values": "red,green,blue,orange",
"optional": true
}
]
A string denoting the current resource being requested or affected.
"native_template"
The relative URL of the current resource being requested or affected.
"/v2/templates/native/1234"
The current resource identifier (ID).
1234
The latest version ID.
522361
A list of IDs of the ad items that reference this template.
[55213, 66514, 64572]
A list of IDs of the ad items that reference an older version of this template.
[]