Please find the request/response below. All client information is removed from the request/response.
#To fetch campaigns:
REQUEST: GET
https://ads-api.twitter.com/0/accounts/:accountId/campaigns
RESPONSE:
{
“next_cursor”: null,
“data_type”: “campaign”,
“request”: {
“params”: {
“account_id”: “[[accountID]]”
}
},
“data”: [
{
“reasons_not_servable”: [
“BUDGET_EXHAUSTED”
],
“account_id”: “[[accounID]]”,
“funding_instrument_id”: “idgo7”,
“paused”: false,
“standard_delivery”: true,
“deleted”: false,
“currency”: “USD”,
“id”: “10z2d”,
“updated_at”: “2013-12-11T01:48:12Z”,
“end_time”: null,
“total_budget_amount_local_micro”: 100000000,
“name”: “Tip List”,
“created_at”: “2013-12-11T01:48:12Z”,
“start_time”: “2013-12-11T01:34:11Z”,
“servable”: false,
“daily_budget_amount_local_micro”: 20000000
}
]
}
#To fetch line items for the campaigns
REQUEST: GET
https://ads-api.twitter.com/0/accounts/:accountId/line_items
RESPONSE:
{
“next_cursor”: null,
“data_type”: “line_item”,
“request”: {
“params”: {
“account_id”: “[[accountId]]”,
“campaign_ids”: [
"[[campaignId]]"
]
}
},
“data”: [
{
“id”: “[[id]]”,
“include_sentiment”: null,
“updated_at”: “2013-12-11T01:48:12Z”,
“objective”: “CUSTOM”,
“bid_amount_local_micro”: 1760000,
“account_id”: “[[]]”,
“paused”: false,
“created_at”: “2013-12-11T01:48:12Z”,
“primary_web_event_tag”: null,
“placement_type”: “PROMOTED_TWEETS_FOR_TIMELINES”,
“deleted”: false,
“campaign_id”: “[[]]”,
“currency”: “USD”
}
],
“total_count”: 1
}
#To fetch Promoted Tweets for line items
REQUEST: GET
https://ads-api.twitter.com/0/accounts/:accounId/promoted_tweets
RESPONSE:
{
“next_cursor”: null,
“data_type”: “promoted_tweet”,
“request”: {
“params”: {
“account_id”: “[]”,
“line_item_id”: “[]”
}
},
“data”: [
{
“id”: “2bxzn”,
“updated_at”: “2014-10-24T20:01:29Z”,
“tweet_id”: “410582257351397376”,
“approval_status”: “ACCEPTED”,
“paused”: false,
“created_at”: “2013-12-11T01:48:12Z”,
“line_item_id”: “[]”,
“deleted”: false
}
],
“total_count”: 1
}
#To fetch associated spend with the promoted tweet
REQUEST: GET
https://ads-api.twitter.com/0/stats/accounts/:accountId/promoted_tweets/[promoted tweet id]
RESPONSE:
{
“data_type”: “stats”,
“request”: {
“params”: {
“account_id”: “[]”,
“end_time”: “2015-02-08T23:59:59Z”,
“granularity”: “TOTAL”,
“start_time”: “2015-02-08T00:00:00Z”,
“promoted_tweet_id”: “[]”
}
},
“data”: {
“promoted_tweet_timeline_retweets”: [
0
],
“promoted_tweet_search_replies”: [
0
],
“conversion_order_quantity”: [
0
],
“conversion_purchases”: [
0
],
“mobile_conversion_sign_ups_breakdown”: {
“total”: [
0
],
“assisted”: [
0
],
“post_engagement”: [
0
],
“post_view”: [
0
]
},
“promoted_tweet_search_favorites”: [
0
],
“promoted_tweet_timeline_impressions”: [
0
],
“id”: “[]”,
“promoted_tweet_timeline_url_clicks”: [
0
],
“mobile_conversion_sign_ups”: [
0
],
“billed_charge_local_micro”: [
0
],
“promoted_tweet_timeline_engagement_rate”: [
0
],
“granularity”: “TOTAL”,
“promoted_tweet_search_card_engagements”: [
0
],
“promoted_tweet_search_url_clicks”: [
0
],
“promoted_tweet_timeline_replies”: [
0
],
“promoted_tweet_timeline_follows”: [
0
],
“promoted_tweet_search_follows”: [
0
],
“promoted_tweet_app_open_attempts”: [
0
],
“promoted_tweet_timeline_engagements”: [
0
],
“promoted_tweet_app_install_attempts”: [
0
],
“promoted_tweet_timeline_card_engagements”: [
0
],
“promoted_tweet_timeline_clicks”: [
0
],
“conversion_downloads”: [
0
],
“promoted_tweet_search_retweets”: [
0
],
“promoted_tweet_search_impressions”: [
0
],
“promoted_tweet_search_engagements”: [
0
],
“conversion_sale_amount”: [
0
],
“conversion_sign_ups”: [
0
],
“mobile_conversion_installs”: [
0
],
“end_time”: “2015-02-08T23:59:59Z”,
“promoted_tweet_search_clicks”: [
0
],
“start_time”: “2015-02-08T00:00:00Z”,
“mobile_conversion_installs_breakdown”: {
“total”: [
0
],
“assisted”: [
0
],
“post_engagement”: [
0
],
“post_view”: [
0
]
},
“mobile_conversion_purchases”: [
0
],
“promoted_tweet_timeline_favorites”: [
0
],
“promoted_tweet_search_engagement_rate”: [
0
],
“mobile_conversion_purchases_breakdown”: {
“total”: [
0
],
“assisted”: [
0
],
“post_engagement”: [
0
],
“post_view”: [
0
]
},
“conversion_custom”: [
0
]
}
}