This creates a new creative template for your network. The body of the request is a JSON object with the below fields. Do not specify an Id
when creating a template. An Id
will be assigned and returned with the response.
All string keys and values are case sensitive. For example
Name
is accepted butname
is not, and the valueString
is accepted butstring
is not.
Fields Object
The Fields
of a creative template set which fields a UI user should enter for a creative. Each Field has its own object:
Key | Type |
---|---|
| Required. The name of the field. Must be 255 characters or less. Example: "Caption" |
| Required. The macro name of the field to be used in the |
| Required. The data type of the field. See the table below. Example: "String" |
| If true, the field will be validated as required when the creative is saved. A required field cannot also be |
| A description of the field for the UI. Example: "This is the caption for the ad." |
| If true, sets whether the field is hidden in the UI. Defaults to |
| Required only if "a" (if string) ["a" "b" "c"] (if array) |
| If true, the field can be queried via the AdQuery feature. |
You cannot provide a
Default
if a Field is notHidden
.If a creative API request sets a value for a
Hidden
field that uses aDefault
, the creative will be saved with that overridden value. Otherwise, the value of the field will be theDefault
.
There is a maximum of 100 fields per creative template.
Field Types
Value | Description | Example |
---|---|---|
| A string. Max length of | "This is some text" |
| A file uploaded directly via the Kevel UI or API. The file name itself uses the Variable name | |
| An external URL of an image | |
| An array of strings. For example, a list of tracking pixels to be served with the ad | ["http://domain.com/pixel1.gif","http://domain2.com/pixel2.gif"] |
| A float |
|
| An object. Max size of |
|
If your template creative requires uploading multiple images, you will need a file Field for uploading the image and a string Field for the image's path. See the example Fields below:
{
"Field": {
"Name": "Image1 Full URL",
"Required": false,
"Variable": "ctImage1",
"Type": "String",
"Hidden": true,
"Default": "{{contentUrl}}/{{ctImage1}}"
}
},
{
"Field": {
"Name": "Image2 Full URL",
"Required": false,
"Variable": "ctImage2",
"Type": "String",
"Hidden": true,
"Default": "{{contentUrl}}/{{ctImage2}}"
}
},
{
"Field": {
"Name": "Image1",
"Required": true,
"Variable": "ctBaseImage1",
"Type": "File"
}
},
{
"Field": {
"Name": "Image2",
"Required": true,
"Variable": "ctBaseImage2",
"Type": "File"
}
}
Contents Object
A creative template can have 0 or more Contents
that determine how the data set in the Fields should be outputted into the creative.
Each Contents has a Type
that corresponds to the data type ados.js should use to render the creative, and the Body
of the Content will be written to contents of the creative.
There is a maximum of 10KB (or 10000 characters) of Contents data per template.
Key | Type |
---|---|
| Required. The data type ados.js should use to render the creative. Ex: "HTML" |
| The data that should be written to the body of the creative. Max 10000 characters. Can use macros. Ex: " Check out my cool caption: {{ctCaption}} " |
Content Types
Value | Description | Example(s) |
---|---|---|
| If served via ados.js, executes the HTML on a page. Can also use macros for displaying uploaded images, etc. This does not wrap the data in any tags, so it can also be used for non-HTML data types such as XML or JSON. |
|
| If served via ados.js, executes JavaScript code in a | No example available |
| If served via ados.js, executes an externally hosted JavaScript file, written into |
|
| If served via ados.js, adds CSS into a page's stylesheet. |
|
| If served via ados.js, wraps the data in a friendly Kevel iframe. If served via the Decision API, can be used for any data type. |
|
Since Decision API responses do not render creatives on a page, the value of a
Type
will instead be rendered as thetype
in response, and theBody
asbody
.