In addition to BANNER and INTERSTITIAL, the Ads API now supports the following creative types:
-
MEDIUM_RECTANGLE: width of 300px and height of 250px
-
BANNER_TABLET: width of 728px and height of 90px
-
INTERSTITIAL_LANDSCAPE: width of 480px and height of 320px
-
INTERSTITIAL_TABLET: width of 768px and height of 1024px
-
INTERSTITIAL_LANDSCAPE_TABLET: width of 1024px and height of 768px
These can be used with the POST accounts/:account_id/account_media endpoint.
Twitter Ads API Team
Example requests and responses:
# upload image
$ twurl -X POST -H upload.twitter.com "/1.1/media/upload.json?additional_owners=756201191646691328" --file image.jpg --file-field "media" | jq
{
"media_id": 812935862862217200,
"media_id_string": "812935862862217218",
"size": 238548,
"expires_after_secs": 86400,
"image": {
"image_type": "image/jpeg",
"w": 768,
"h": 1024
}
}
# associate account media with the current account
$ twurl -X POST -H ads-api.twitter.com "/1/accounts/18ce54d4x5t/account_media" -d "creative_type=INTERSTITIAL_TABLET&media_id=812935862862217218" | jq
{
"data_type": "account_media",
"data": {
"video_id": null,
"media_url": "https://pbs.twimg.com/ad_img/812935862862217218/Xv0yst10?format=jpg&name=orig",
"creative_type": "INTERSTITIAL_TABLET",
"vast_url": null,
"id": "yiq7",
"account_id": "18ce54d4x5t",
"created_at": "2016-12-25T08:20:40Z",
"updated_at": "2016-12-25T08:20:40Z",
"deleted": false
},
"request": {
"params": {
"account_id": "18ce54d4x5t",
"media_id": 812935862862217200,
"creative_type": "INTERSTITIAL_TABLET"
}
}
}