Scheduled Tweets
GET accounts/:account_id/scheduled_tweets¶
Retrieve details for some or all Scheduled Tweets associated with the current account.
Resource URL¶
https://ads-api.x.com/12/accounts/:account_id/scheduled_tweets
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:
|
count optional |
Specifies the number of records to try and retrieve per distinct request. Type: int Default:
100 Min, Max: 1 ,
200 |
cursor optional |
Specifies a cursor to get the next page of results. See Pagination for more information. Type: string Example:
|
user_id optional |
Specify the user to retrieve Scheduled Tweets for. Defaults to
the Type: long Example:
|
Example Request¶
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/scheduled_tweets?count=1
Example Response¶
{
"request": {
"params": {
"count": 1
}
},
"data": [
{
"name": "test name",
"completed_at": "2017-06-18T22:00:05Z",
"text": "where you want to be",
"user_id": "756201191646691328",
"scheduled_status": "SUCCESS",
"id": "875828692081037312",
"nullcast": true,
"created_at": "2017-06-16T21:33:27Z",
"scheduled_at": "2017-06-18T22:00:00Z",
"card_uri": null,
"updated_at": "2017-06-19T18:02:20Z",
"tweet_id": "876560168963645440",
"media_keys": []
}
],
"next_cursor": "c-j41uw400"
}
GET accounts/:account_id/scheduled_tweets/:scheduled_tweet_id¶
Retrieve a specific Scheduled Tweet associated with the current account.
Resource URL¶
https://ads-api.x.com/12/accounts/:account_id/scheduled_tweets/:scheduled_tweet_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:
|
scheduled_tweet_id required |
A reference to the Scheduled Tweet you are operating with in the request. Type: string Example:
|
Example Request¶
GET https://ads-api.x.com/12/accounts/18ce54d4x5t/scheduled_tweets/917438609065623552
Example Response¶
{
"request": {
"params": {
"scheduled_tweet_id": "917438609065623552"
}
},
"data": {
"name": null,
"completed_at": null,
"text": "",
"user_id": "756201191646691328",
"scheduled_status": "SCHEDULED",
"id": "917438609065623552",
"nullcast": true,
"created_at": "2017-10-09T17:16:24Z",
"scheduled_at": "2018-01-01T00:00:00Z",
"card_uri": null,
"updated_at": "2017-10-09T17:16:24Z",
"tweet_id": null,
"media_keys": [
"3_917438348871983104"
]
}
}
POST accounts/:account_id/scheduled_tweets¶
Create a Scheduled Tweet for the account's full promotable user
(default) or the user specified in the as_user_id
parameter.
Resource URL¶
https://ads-api.x.com/12/accounts/:account_id/scheduled_tweets
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:
|
scheduled_at required |
The time, expressed in ISO 8601, that the Tweet should be published (or go live). Note: Tweets can only be scheduled up to one year in the future. Note: Tweets should only be scheduled at minute-granularity; seconds will be ignored. Type: string Example: |
as_user_id required |
The user ID of the advertiser on behalf of whom you are posting the Tweet. The advertiser must grant your handle (or handles) access to their ads account via ads.twitter.com. This permission allows you to call the API using the OAuth tokens of your own handle rather than the advertiser's. Type: long Example:
|
text sometimes required |
The text of your status update. Required if no
Type: string Example:
|
card_uri optional |
Associate a card with the Tweet using the Type: string Example: |
media_keys optional |
Associate media with the Tweet by specifying a comma-separated list of identifiers. Include up to 4 images, 1 animated GIF, or 1 video. Note: The media asset must be in the account's Media Library. Type: string Example:
|
nullcast optional |
Whether to create a nullcasted (or "Promoted-only") Tweet. Type: boolean Default:
true Possible values: true ,
false |
name optional |
The name for the Scheduled Tweet. Maximum length: 80 characters. Type: string Example:
|
Example Request¶
POST https://ads-api.x.com/12/accounts/18ce54d4x5t/scheduled_tweets?as_user_id=756201191646691328&media_keys=3_917438348871983104&scheduled_at=2018-01-01
Example Response¶
{
"request": {
"params": {
"media_keys": [
"3_917438348871983104"
],
"scheduled_at": "2018-01-01T00:00:00Z",
"as_user_id": 756201191646691328
}
},
"data": {
"name": null,
"completed_at": null,
"text": "",
"user_id": "756201191646691328",
"scheduled_status": "SCHEDULED",
"id": "917438609065623552",
"nullcast": true,
"created_at": "2017-10-09T17:16:24Z",
"scheduled_at": "2018-01-01T00:00:00Z",
"card_uri": null,
"updated_at": "2017-10-09T17:16:24Z",
"tweet_id": null,
"media_keys": [
"3_917438348871983104"
]
}
}
PUT accounts/:account_id/scheduled_tweets/:scheduled_tweet_id¶
Update the specified Scheduled Tweet belonging to the current account.
Resource URL¶
https://ads-api.x.com/12/accounts/:account_id/scheduled_tweets/:scheduled_tweet_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:
|
scheduled_tweet_id required |
A reference to the Scheduled Tweet you are operating with in the request. Type: string Example:
|
card_uri optional |
Associate a card with the Tweet using the Note: Unset (remove) by specifying the parameter without a value. Type: string Example:
|
media_keys optional |
Associate media with the Tweet by specifying a comma-separated list of identifiers. Include up to 4 images, 1 animated GIF, or 1 video. Note: The media asset must be in the account's Media Library. Note: Unset (remove) by specifying the parameter without a value. Type: string Example:
|
nullcast optional |
Whether to create a nullcasted (or "Promoted-only") Tweet. Type: boolean Possible values: |
scheduled_at optional |
The time, expressed in ISO 8601, that the Tweet should be published (or go live). Type: string Example: |
text optional |
The text of your status update. Type: string Example:
|
name optional |
The name for the Scheduled Tweet. Maximum length: 80 characters. Type: string Example:
|
Example Request¶
PUT https://ads-api.x.com/12/accounts/18ce54d4x5t/scheduled_tweets/875057751231037440?text=winter solstice
Example Response¶
{
"request": {
"params": {
"scheduled_tweet_id": "875057751231037440",
"text": "winter solstice"
}
},
"data": {
"name": null,
"completed_at": null,
"scheduled_status": "SCHEDULED",
"text": "winter solstice",
"user_id": "756201191646691328",
"id": "875057751231037440",
"nullcast": true,
"created_at": "2017-06-14T18:30:00Z",
"scheduled_at": "2017-12-21T00:00:00Z",
"card_uri": null,
"updated_at": "2017-06-14T18:30:00Z",
"tweet_id": null,
"media_keys": []
}
}
DELETE accounts/:account_id/scheduled_tweets/:scheduled_tweet_id¶
Permanently delete the specified Scheduled Tweet belonging to the current account.
Note: This is a hard delete. As a result, it is not possible to retrieve deleted Scheduled Tweets.
Resource URL¶
https://ads-api.x.com/12/accounts/:account_id/scheduled_tweets/:scheduled_tweet_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:
|
scheduled_tweet_id required |
A reference to the Scheduled Tweet you are operating with in the request. Type: string Example:
|
Example Request¶
DELETE https://ads-api.x.com/12/accounts/18ce54d4x5t/scheduled_tweets/875064008595787776
Example Response¶
{
"request": {
"params": {
"scheduled_tweet_id": 875064008595787776
}
},
"data": {
"name": null,
"completed_at": null,
"scheduled_status": "DELETED",
"text": "hello, world",
"user_id": "756201191646691328",
"id": "875064008595787776",
"nullcast": true,
"created_at": "2017-06-14T18:54:52Z",
"scheduled_at": "2017-06-15T00:00:00Z",
"card_uri": null,
"updated_at": "2017-06-14T19:01:16Z",
"tweet_id": null,
"media_keys": []
}
}