Creatives
Website Cards¶
Note: card_uri
is replacing preview_url
. This moves
associating a card with a Tweet from the Tweet text to a Tweet parameter. To
associate a card with a Tweet, use the card_uri
parameter with either the
POST accounts/:account_id/tweet, POST statuses/update, or
POST accounts/:account_id/scheduled_tweets endpoints. This allows users to
use more characters in their Tweets.
GET accounts/:account_id/cards/website¶
Retrieve details for some or all website cards associated with the current account.
Resource URL¶
https://ads-api.twitter.com/3/accounts/:account_id/cards/website
Parameters¶
Name | Description |
---|---|
account_id
required
|
The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: |
card_ids
optional
|
Scope the response to just the desired website cards by specifying a comma-separated list of identifiers. Up to 200 IDs may be provided. Type: string Example: |
count
optional
|
Specifies the number of records to try and retrieve per distinct request. Type: int Default:
200 Min, Max:
1 , 1000 |
cursor
optional
|
Specifies a cursor to get the next page of results. See Pagination for more information. Type: string Example: |
q
optional
|
An optional query to scope cards by Type: string Example: |
sort_by
optional
|
Sorts by supported attribute in ascending or descending order. See Sorting for more information. Type: string Example: |
with_deleted
optional
|
Include deleted results in your request. Type: boolean Default:
false Possible values:
true , false |
with_total_count
optional
|
Include the Note: This parameter will be ignored if Note: Requests which include Type: boolean Default:
false Possible values:
true , false |
Example Request¶
GET https://ads-api.twitter.com/3/accounts/18ce54d4x5t/cards/website?card_ids=59wh0
Example Response¶
{
"request": {
"params": {
"card_type": "website",
"card_ids": [
"59wh0"
],
"account_id": "18ce54d4x5t"
}
},
"next_cursor": null,
"data": [
{
"name": "website card",
"website_shortened_url": "https://t.co/zadeUSVD18",
"image_display_height": "418",
"image": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
"preview_url": null,
"website_display_url": "developer.twitter.com",
"id": "59wh0",
"account_id": "18ce54d4x5t",
"website_dest_url": "https://developer.twitter.com",
"created_at": "2018-01-27T00:15:19Z",
"image_display_width": "800",
"website_title": "Twitter Developers",
"card_uri": "card://957044309437526017",
"website_url": "https://developer.twitter.com",
"updated_at": "2018-01-27T00:15:19Z",
"deleted": false,
"card_type": "WEBSITE"
}
]
}
GET accounts/:account_id/cards/website/:card_id¶
Retrieve a specific website card associated with the current account.
Resource URL¶
https://ads-api.twitter.com/3/accounts/:account_id/cards/website/:card_id
Parameters¶
Name | Description |
---|---|
account_id
required
|
The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: |
card_id
required
|
A reference to the website card you are operating with in the request. Type: string Example: |
with_deleted
optional
|
Include deleted results in your request. Type: boolean Default:
false Possible values:
true , false |
Example Request¶
GET https://ads-api.twitter.com/3/accounts/18ce54d4x5t/cards/website/59wh0
Example Response¶
{
"request": {
"params": {
"card_type": "website",
"card_id": "59wh0",
"account_id": "18ce54d4x5t"
}
},
"data": {
"name": "website card",
"website_shortened_url": "https://t.co/zadeUSVD18",
"image_display_height": "418",
"image": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
"preview_url": null,
"website_display_url": "developer.twitter.com",
"id": "59wh0",
"account_id": "18ce54d4x5t",
"website_dest_url": "https://developer.twitter.com",
"created_at": "2018-01-27T00:15:19Z",
"image_display_width": "800",
"website_title": "Twitter Developers",
"card_uri": "card://957044309437526017",
"website_url": "https://developer.twitter.com",
"updated_at": "2018-01-27T00:15:19Z",
"deleted": false,
"card_type": "WEBSITE"
}
}
POST accounts/:account_id/cards/website¶
Create a new website card associated with the current account.
Resource URL¶
https://ads-api.twitter.com/3/accounts/:account_id/cards/website
Parameters¶
Name | Description |
---|---|
account_id
required
|
The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: |
name
required
|
The name for the card. Type: string Example: |
website_title
required
|
The title for the card. Type: string Example: |
website_url
required
|
The URL of the website to redirect a user to. Type: string Example: |
image_media_id
sometimes required
|
A This is a write-only field. In the response, the API will provide a Twitter URL for this image. Note: Required if Note: A minimum image width of 800px and a width:height aspect ratio of either 1:1 or 1.91:1 is required. Type: long Example: |
image_media_key
sometimes required
|
The This is a write-only field. In the response, the API will provide a Twitter URL for this image. Note: The image must be in the account’s media library. Note: Required if Note: A minimum image width of 800px and a width:height aspect ratio of either 1:1 or 1.91:1 is required. Type: string Example: |
Example Request¶
POST https://ads-api.twitter.com/3/accounts/18ce54d4x5t/cards/website?image_media_key=3_955505955445268480&name=website card&website_title=Twitter Developers&website_url=https://developer.twitter.com
Example Response¶
{
"data": {
"name": "website card",
"website_shortened_url": "https://t.co/zadeUSVD18",
"image_display_height": "418",
"image": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
"preview_url": null,
"website_display_url": "developer.twitter.com",
"id": "59wh0",
"account_id": "18ce54d4x5t",
"website_dest_url": "https://developer.twitter.com",
"created_at": "2018-01-27T00:15:19Z",
"image_display_width": "800",
"website_title": "Twitter Developers",
"card_uri": "card://957044309437526017",
"website_url": "https://developer.twitter.com",
"updated_at": "2018-01-27T00:15:19Z",
"deleted": false,
"card_type": "WEBSITE"
},
"request": {
"params": {
"name": "website card",
"website_shortened_url": "https://t.co/zadeUSVD18",
"image_display_height": "418",
"image": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
"image_media_key": "3_955505955445268480",
"website_display_url": "developer.twitter.com",
"account_id": "18ce54d4x5t",
"website_dest_url": "https://developer.twitter.com",
"image_display_width": "800",
"website_title": "Twitter Developers",
"website_url": "https://developer.twitter.com",
"card_type": "WEBSITE"
}
}
}
PUT accounts/:account_id/cards/website/:card_id¶
Update the specified website card belonging to the current account.
Resource URL¶
https://ads-api.twitter.com/3/accounts/:account_id/cards/website/:card_id
Parameters¶
Name | Description |
---|---|
account_id
required
|
The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: |
card_id
required
|
A reference to the website card you are operating with in the request. Type: string Example: |
image_media_id
optional
|
A This is a write-only field. In the response, the API will provide a Twitter URL for this image. Note: A minimum image width of 800px and a width:height aspect ratio of either 1:1 or 1.91:1 is required. Type: long Example: |
image_media_key
optional
|
The This is a write-only field. In the response, the API will provide a Twitter URL for this image. Note: The image must be in the account’s media library. Note: A minimum image width of 800px and a width:height aspect ratio of either 1:1 or 1.91:1 is required. Type: string Example: |
name
optional
|
The name for the card. Type: string Example: |
website_title
optional
|
The title for the card. Type: string Example: |
website_url
optional
|
The URL of the website to redirect a user to. Type: string Example: |
Example Request¶
PUT https://ads-api.twitter.com/3/accounts/18ce54d4x5t/cards/website/59w2c?name=coffee card
Example Response¶
{
"data": {
"name": "coffee card",
"website_shortened_url": "https://t.co/TvmIOd0wXq",
"image_display_height": "418",
"image": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
"preview_url": null,
"website_display_url": "developer.twitter.com",
"id": "59w2c",
"account_id": "18ce54d4x5t",
"website_dest_url": "https://developer.twitter.com/",
"created_at": "2018-01-26T21:11:48Z",
"image_display_width": "800",
"website_title": "Twitter Developers",
"card_uri": "card://956998127856177153",
"website_url": "https://developer.twitter.com/",
"updated_at": "2018-01-27T00:20:18Z",
"deleted": false,
"card_type": "WEBSITE"
},
"request": {
"params": {
"account_id": "18ce54d4x5t",
"card_type": "WEBSITE",
"card_id": "59w2c",
"name": "coffee card"
}
}
}
DELETE accounts/:account_id/cards/website/:card_id¶
Permanently delete the specified website card belonging to the current account.
Note: This is a hard delete. As a result, it is not possible to retrieve deleted cards.
Resource URL¶
DELETE accounts/:account_id/cards/website/:card_id
Parameters¶
Name | Description |
---|---|
account_id
required
|
The identifier for the leveraged account. Appears within the resource’s path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user. Type: string Example: |
card_id
required
|
A reference to the website card you are operating with in the request. Type: string Example: |
Example Request¶
DELETE https://ads-api.twitter.com/3/accounts/18ce54d4x5t/cards/website/4i91t
Example Response¶
{
"data": {
"name": "website card",
"id": "4i91t",
"account_id": "18ce54d4x5t",
"created_at": "2017-07-08T06:05:17Z",
"updated_at": "2017-08-23T13:33:50Z",
"deleted": true,
"card_type": "WEBSITE"
},
"request": {
"params": {
"card_id": "4i91t",
"card_type": "website",
"account_id": "18ce54d4x5t"
}
}
}