pryabov
pryabov

Reputation: 854

How to Add Call-to-Action Button Inside Tweets via Twitter API

Will be very thankful if somebody could share their experience how to add call-to-action button inside tweets which posted through Twitter API: POST statuses/update

Expected result

  1. Subscribe button inside tweet

enter image description here

  1. After clicking on this button Subscription dialog appears

enter image description here

Thanks for any help

Upvotes: 1

Views: 1953

Answers (1)

Jack Harding
Jack Harding

Reputation: 52

https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/cards/website

{
  "data": {
    "name": "Test Website Card 1",
    "id": "g9z",
    "preview_url": "https://cards.twitter.com/cards/abc1/g9z",
    "created_at": "2014-05-18T21:29:18Z", 
    "card_type": "WEBSITE",
    "updated_at": "2014-05-18T21:29:18Z",
    "website_cta": "READ_MORE",
    "account_id": "abc1"
  },
   "data_type": "card",
   "request": {
    "params": {
     "name": "Test Website Card 1",
     "card_type": "WEBSITE",
     "account_id": "abc1",
     "image": "https://pbs.twimg.com/peacock/398520248267071488/image.jpg",
     "website_url": "https://support.twitter.com/",
     "website_title": "Twitter Help Center",
     "website_cta": "SUBSCRIBE",

    }
  }
}
enter code here

The bottom line, "website_cta": "SUBSCRIBE", will set the call-to-action (cta) to subscribe.

Upvotes: 2

Related Questions