Allows updating or creating specific types of creatives. Currently Banner creatives and CustomTag (HTML/JS) creatives can be updated, and only CustomTag creatives can be created.
When adding a new creative, id must be null, and the fields campaignId, creativeType, and creativeSubType must be provided. As of this writing only the HTML/JS based CustomTag banners can be created, so the caller must set:
"creativeType": "banner"
and
"creativeSubtype": "htmlTag",
Allows updating or creating specific types of creatives.
For creating a creative:
- ID must be null or omitted
- creativeType and creativeSubType must be provided
- advertiserId or campaignId must be included (both may be included, but at least one of the two must be included)
Request
POST /creative/save
RequestBody
Create
| Name | Type | Description | Required |
|---|---|---|---|
| name | String | Creative name | Yes |
| type | Object | See Type Object | Yes |
| size | Object | See Size Object | Yes |
| advertiserId | Number | Advertiser ID associated with the campaign. | Yes* |
| htmlAsset | String | Yes | |
| creativeType | String | Yes | |
| creativeSubType | String | Yes | |
| campaignId | Number | Yes* |
Update
| Name | Type | Description | Required |
|---|---|---|---|
| id | Number | Creative ID | Yes |
| name | String | Creative name | Yes |
| type | See Type Object | Yes | |
| size | See Size Object | Yes | |
| advertiserId | Number | Advertiser ID associated with the campaign. | Yes* |
| htmlAsset | String | Yes | |
| creativeType | String | Yes | |
| creativeSubType | String | Yes | |
| campaignId | Number | Yes* |
*: One of advertiserId or campaignId is required; both may be included.
Type
| Name | Type | Description | Required |
|---|---|---|---|
| id | Number | Media type ID | Yes |
| vendor | String | Vendor name or "Generic" | No |
| mediaType | String | One of: BANNER, VAST, NATIVE, MRAID, VPAID, VAST_WITH_VPAID | Yes |
| videoType | String | One of: FLV, MP4, WMV, WEBM, JS, null | Yes; set to null for non-video Creative |
Size
| Name | Type | Description | Required |
|---|---|---|---|
| width | Number | Creative width, if applicable, or null | Yes |
| height | Number | Creative height, if applicable, or null | Yes |
Response
| JSON Fields | Type | Description |
|---|---|---|
| messages | Object Array | An array of any error messages. |
| messages[].level | String | Error level. |
| messages[].code | String | Error code. |
| messages[].message | String | Error message. |
| entity | Object | Object is a Creative |
| entity.id | Number | Creative ID. |
| entity.status | String | Status of the creative. It can be one of the following values:
|
| entity.name | String | Creative name. |
| entity.type | Object | |
| entity.type.id | Number | Creative type ID as shown in the UI. |
| entity.type.vendorId | String | Creative type vendor as shown in the UI. |
| entity.type.mediaType | String | Can be one of the following values:
|
| entity.type.videoType | String | Will be null for non-video creative types. Can be on of the following values:
|
| entity.externalCreativeid | String | |
| entity.crawlableUrl | String | Crawlable URL for what the creative is advertising |
| entity.landingPageUrl | String | Clickthrough URL for the creative. This may not be the final destination. |
| entity.impressionTrackingPixel_1 | String | URL of first tracking pixel |
| entity.impressionTrackingPixel_2 | String | URL of second tracking pixel |
| entity.impressionTrackingPixel_3 | String | URL of third tracking pixel |
| entity.impressionTrackingPixel_4 | String | URL of fourth tracking pixel |
| entity.size | Object | |
| entity.size.width | Number | Width of creative (if applicable) |
| entity.size.height | Number | Height of creative (if applicable) |
| entity.channels | String Array | Channels selected for this creative. Possible values are:
|
| entity.adTagId | String | AdTag identifier. Varies by vendor. Only populated on AdTag type creatives |
| entity.duration | Number | Duration of creative in seconds. Currently only populated for video type creatives. |
| entity.bitRate | Number | Bitrate of creative. Currently only populated for video type creatives. |
| entity.htmlAsset | String | Text asset. Only valid for text-based banner creatives |
| entity.campaignId | Number | ID of the creative's campaign NOTE: One of Campaign ID and Advertiser ID is required, but not both. Both can be provided, but that's not required. |
| entity.advertiserId | Number | ID of the creative's advertiser |
| entity.creativeType | String | Broad type category of creative analogous to the first step of the UI wizard. Only used for inputting new creatives. |
| entity.creativeSubType | String | Specific type category of creative analogous to the second step of the UI wizard. Only used for inputting new creatives. |
| entity.previewUrl | String | Preview URL for the creative |
| entity.display | Object | |
| entity.display.imageUrl | string | URL for creative image |
| entity.display.htmlAsset | string | Text asset. Only valid for text-based banner creatives |
Examples
Request to add a creative
curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"name": "Test_create_min", "type": { "id": 4, "vendor": "Generic", "mediaType": "BANNER", "videoType": null }, "size": { "width": 300, "height": 250 }, "htmlAsset": "<script type=\"text/javascript\" src=\"https://voken.eyereturn.com/j4/js?6710639&click=${VIANT_CLICK_REDIRECT_PROVIDED_ENC}¶ms=${VIANT_CACHE_BUSTER}\"></script>", "creativeType": "banner", "creativeSubtype": "htmlTag", "campaignId": 4597 }' https://sandbox-api.viant.com/v1/creative/save
Response
{
"messages": [],
"entity": {
"id": 23887175,
"name": "Test_create_min",
"type": {
"id": 4,
"vendorId": 1,
"mediaType": "BANNER",
"videoType": null
},
"status": "PENDING",
"externalCreativeid": null,
"crawlableUrl": null,
"impressionTrackingPixel_1": null,
"impressionTrackingPixel_2": null,
"impressionTrackingPixel_3": null,
"impressionTrackingPixel_4": null,
"size": {
"width": 300,
"height": 250
},
"channels": [
"DESKTOP",
"MOBILE"
],
"landingPageUrl": null,
"htmlAsset": "<script type=\"text/javascript\" src=\"https://voken.eyereturn.com/j4/js?6710639&click=${ADELPHIC_CLICK_REDIRECT_PROVIDED_ENC}¶ms=${ADELPHIC_CACHE_BUSTER}\"></script>",
"campaignId": null,
"advertiserId": 94328,
"creativeType": "banner",
"creativeSubtype": "tag",
"previewUrl": "http://ad.ipredictive.com/d/render/fasttrack?zid=shanghai_1_0_1&creativeId=23887175",
"display": {
"imageUrl": null,
"htmlAsset": "<script type=\"text/javascript\" src=\"https://voken.eyereturn.com/j4/js?6710639&click=${ADELPHIC_CLICK_REDIRECT_PROVIDED_ENC}¶ms=${ADELPHIC_CACHE_BUSTER}\"></script>"
}
}
}
Request to update a creative
curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"id": 2205732,"name": "Testtttt_edit"}' https://sandbox-api.viant.com/v1/creative/save
Response
{
"messages": [],
"entity": {
"id": 23887175,
"name": "Test_update_min0",
"type": {
"id": 4,
"vendorId": 1,
"mediaType": "BANNER",
"videoType": null
},
"status": "PENDING",
"externalCreativeid": null,
"crawlableUrl": null,
"impressionTrackingPixel_1": null,
"impressionTrackingPixel_2": null,
"impressionTrackingPixel_3": null,
"impressionTrackingPixel_4": null,
"size": {
"width": 300,
"height": 250
},
"channels": [
"DESKTOP",
"MOBILE"
],
"landingPageUrl": null,
"htmlAsset": "<script type=\"text/javascript\" src=\"https://voken.eyereturn.com/j4/js?6710639&click=${ADELPHIC_CLICK_REDIRECT_PROVIDED_ENC}¶ms=${ADELPHIC_CACHE_BUSTER}\"></script>",
"campaignId": null,
"advertiserId": 94328,
"creativeType": "banner",
"creativeSubtype": "tag",
"previewUrl": "http://ad.ipredictive.com/d/render/fasttrack?zid=shanghai_1_0_1&creativeId=23887175",
"display": {
"imageUrl": null,
"htmlAsset": "<script type=\"text/javascript\" src=\"https://voken.eyereturn.com/j4/js?6710639&click=${ADELPHIC_CLICK_REDIRECT_PROVIDED_ENC}¶ms=${ADELPHIC_CACHE_BUSTER}\"></script>"
}
}
}