Example native template API
While we work on updating our API documentation to include newer additions such as Native Templates, we wanted to make an example available for users in the meantime.
POST /v2/templates/native
{
"name": "Example Template",
"raw_html": "<a href=\"[%URL%]\">\r\n [%Image Tag%]\r\n<\/a>\r\n<p>[%Body Text%]<\/p>",
"variables": [
{
"name": "Body Text",
"placeholder": "[%Body Text%]",
"type": "text",
"max_length": "50"
},
{
"name": "URL",
"placeholder": "[%URL%]",
"type": "url"
},
{
"name": "Image Tag",
"placeholder": "[%Image Tag%]",
"type": "file"
}
]
}
GET /v2/templates/native/{ID}
{
"object": "native_template",
"self": "\/v2\/templates\/native\/56",
"id": 56,
"latest_version_id": 56,
"raw_html": "<a href=\"[%URL%]\">\r\n [%Image Tag%]\r\n<\/a>\r\n<p>[%Body Text%]<\/p>",
"name": "Example",
"created_date": "0000-00-00 00:00:00",
"updated_date": null,
"variables": [{
"id": 41,
"name": "Body Text",
"placeholder": "[%Body Text%]",
"type": "text",
"max_length": "50",
"dropdown_values": null
}, {
"id": 42,
"name": "URL",
"placeholder": "[%URL%]",
"type": "url",
"max_length": "0",
"dropdown_values": null
}, {
"id": 43,
"name": "Image Tag",
"placeholder": "[%Image Tag%]",
"type": "file",
"max_length": "0",
"dropdown_values": null
}],
"references": [],
"outdated_references": []
}
POST /v2/ad-items/native
{
"name": "Native Ad Item Example",
"location": "",
"tracking_pixel": "",
"template": 56,
"variables": {
"41": "Lorem ipsum dolor sit amet, consectetur adipiscing",
"42": "https:\/\/adbutler.com",
"43": "https:\/\/www.adbutler.com\/assets\/fullstack\/assets\/images\/logo.svg"
},
"width": 300,
"height": 250
}