Get a List of Native Templates
curl --request GET \
--url https://api.hakumedia.ai/v2/templates/native \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.hakumedia.ai/v2/templates/native', 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"
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",
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;
}{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/templates/native",
"data": [
{
"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": []
}
]
}Native Templates
Get a List of Native Templates
You can use the fields query parameter to restrict the fields to be retrieved.
GET
/
templates
/
native
Get a List of Native Templates
curl --request GET \
--url https://api.hakumedia.ai/v2/templates/native \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.hakumedia.ai/v2/templates/native', 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"
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",
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;
}{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/templates/native",
"data": [
{
"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": []
}
]
}Autorizaciones
Parámetros de consulta
Respuesta
200 - application/json
successful operation