Card URI response attribute in Standard API

restapi
announcements

#1

The Standard API’s GET statuses/show/:id* and GET statuses/lookup* endpoints now support the include_card_uri boolean request parameter. When set to true, the response will include the card_uri attribute only if:

  • there is a card attached to the Tweet
  • the card was attached using the card_uri value
$ twurl -H api.twitter.com "/1.1/statuses/show/966786488842072064.json?trim_user=true&include_card_uri=true"
{
  "created_at": "Thu Feb 22 21:27:15 +0000 2018",
  "id": 966786488842072064,
  "id_str": "966786488842072064",
  "text": "video app card with card_uri",
  "truncated": false,
  "entities": {
    "hashtags": [],
    "symbols": [],
    "user_mentions": [],
    "urls": []
  },
  "source": "<a href=\"https://ads-api.twitter.com\" rel=\"nofollow\">Ads API Internal Test App</a>",
  "in_reply_to_status_id": null,
  "in_reply_to_status_id_str": null,
  "in_reply_to_user_id": null,
  "in_reply_to_user_id_str": null,
  "in_reply_to_screen_name": null,
  "user": {
    "id": 756201191646691328,
    "id_str": "756201191646691328"
  },
  "geo": null,
  "coordinates": null,
  "place": null,
  "contributors": null,
  "is_quote_status": false,
  "retweet_count": 0,
  "favorite_count": 0,
  "favorited": false,
  "retweeted": false,
  "scopes": {
    "followers": false
  },
  "lang": "en",
  "card_uri": "card://958233417929261056"
}
$ twurl -H api.twitter.com "/1.1/statuses/lookup.json?id=966786488842072064&trim_user=true&include_card_uri=true"
[
  {
    "created_at": "Thu Feb 22 21:27:15 +0000 2018",
    "id": 966786488842072064,
    "id_str": "966786488842072064",
    "text": "video app card with card_uri",
    "truncated": false,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": []
    },
    "source": "<a href=\"https://ads-api.twitter.com\" rel=\"nofollow\">Ads API Internal Test App</a>",
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "user": {
      "id": 756201191646691328,
      "id_str": "756201191646691328"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 0,
    "favorited": false,
    "retweeted": false,
    "scopes": {
      "followers": false
    },
    "lang": "en",
    "card_uri": "card://958233417929261056"
  }
]

If you have access to the ads account the card belongs to, you can use our GET accounts/:account_id/cards endpoint to retrieve additional card details.

$ twurl -H ads-api.twitter.com "/3/accounts/18ce54d4x5t/cards?card_uri=card://958233417929261056"
{
  "request": {
    "params": {
      "card_uri": "card://958233417929261056",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "name": "aerial card",
    "googleplay_app_id": "com.twitter.android",
    "video_url": "https://video.twimg.com/amplify_video/vmap/958231855240589313.vmap",
    "video_owner_id": "756201191646691328",
    "video_content_id": "958231855240589313",
    "preview_url": null,
    "id": "5a4z3",
    "account_id": "18ce54d4x5t",
    "app_country_code": "US",
    "video_hls_url": "https://video.twimg.com/amplify_video/958231855240589313/pl/vHKJ2aH1tZGKW3bh.m3u8",
    "created_at": "2018-01-30T07:00:24Z",
    "card_uri": "card://958233417929261056",
    "updated_at": "2018-01-30T07:32:00Z",
    "video_poster_url": "https://pbs.twimg.com/amplify_video_thumb/958231855240589313/img/rjhswYG084qYYgF6.jpg",
    "app_cta": "INSTALL",
    "deleted": false,
    "card_type": "VIDEO_APP_DOWNLOAD"
  }
}

Twitter Ads API Team


* Documentation will be updated soon.


PromotedTweetからCard情報を取得する方法について
広告idごとに使用しているカードを特定したい
#2

#3