预排期推文

GET accounts/:account_id/scheduled_tweets

检索与当前账号关联的部分或所有预排期推文详细信息。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/scheduled_tweets

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

count
可选

指定每个不同请求尝试检索的记录数量。

类型:int

默认值:100
最小值、最大值:1200
cursor
可选

指定光标以获取下一页结果。参阅分页了解更多信息。

类型:string

示例:c-j3cn6n40

user_id
可选

指定检索其预排期推文的用户。未设置时,默认为账号的 FULL 可推广用户。

类型:long

示例:756201191646691328

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/scheduled_tweets?count=1

响应示例

{
  "request": {
    "params": {
      "count": 1
    }
  },
  "data": [
    {
      "completed_at": "2017-06-18T22:00:05Z",
      "id_str": "875828692081037312",
      "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

检索与当前账号关联的特定预排期推文。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/scheduled_tweets/:scheduled_tweet_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

scheduled_tweet_id
必需

请求中对正在操作的预排期推文的引用。

类型:long

示例:917438609065623552

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/scheduled_tweets/917438609065623552

响应示例

{
  "request": {
    "params": {
      "scheduled_tweet_id": 917438609065623552
    }
  },
  "data": {
    "completed_at": null,
    "id_str": "917438609065623552",
    "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

为账号的可完全推广用户(默认)或 as_user_id 参数中指定的用户创建预排期推文。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/scheduled_tweets

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

scheduled_at
必需

推文应发布(或上线)的时间(以 ISO 8601 格式表示)。

注意:最多只可在未来一年内预排期推文。

注意:推文只能以分钟为间隔进行预排期,秒钟预排期将被忽略。

类型:string

示例:2017-12-31T23:59:00Z

as_user_id
必需

要代表其发布推文的广告商用户 ID。广告商必须通过 ads.twitter.com,向您的用户名授予访问其广告账号的权限。此权限允许你使用自己用户名(而非广告商的用户名)的 OAuth 令牌调用该 API。

类型:long

示例:756201191646691328

text
有时为必需

状态更新文本。如未指定 media_keys 则为必需。

类型:string

示例:just setting up my twttr

card_uri
可选

使用任何卡片响应中的 card_uri 值将卡片关联到推文(如可用)。

类型:string

示例:card://855591459410511943

media_keys
可选

通过指定以逗号分隔的标识符列表,将媒体关联到推文。最多可包含 4 个图像、1 个动画 GIF 或 1 个视频。

注意:媒体资源必须位于账号的媒体库中。

类型:string

示例:13_1153584529292270722

nullcast
可选

是否创建 cast 为空(或“仅推广”)的推文。

类型:boolean

默认值:true
可能值:truefalse

请求示例

POST https://ads-api.twitter.com/10/accounts/18ce54d4x5t/scheduled_tweets?as_user_id=756201191646691328&media_keys=3_917438348871983104&scheduled_at=2018-01-01

响应示例

{
  "request": {
    "params": {
      "media_keys": [
        "3_917438348871983104"
      ],
      "scheduled_at": "2018-01-01T00:00:00Z",
      "as_user_id": 756201191646691328
    }
  },
  "data": {
    "completed_at": null,
    "id_str": "917438609065623552",
    "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

更新属于当前账号的指定预排期推文。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/scheduled_tweets/:scheduled_tweet_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

scheduled_tweet_id
必需

请求中对正在操作的预排期推文的引用。

类型:long

示例:870321875435442177

card_uri
可选

使用任何卡片响应中的 card_uri 值将卡片关联到推文(如可用)。

注意:通过指定没有值的参数来取消设置(删除)。

类型:string

示例:card://875146925316386347

media_keys
可选

通过指定以逗号分隔的标识符列表,将媒体关联到推文。最多可包含 4 个图像、1 个动画 GIF 或 1 个视频。

注意:媒体资源必须位于账号的媒体库中。

注意:通过指定没有值的参数来取消设置(删除)。

类型:string

示例:13_1153584529292270722

nullcast
可选

是否创建 cast 为空(或“仅推广”)的推文。

类型:boolean

可能值:truefalse

scheduled_at
可选

推文应发布(或上线)的时间(以 ISO 8601 格式表示)。

类型:string

示例:2017-12-31T23:59:59Z

text
可选

状态更新文本。

类型:string

示例:just setting up my twttr

请求示例

PUT https://ads-api.twitter.com/10/accounts/18ce54d4x5t/scheduled_tweets/875057751231037440?text=winter solstice

响应示例

{
  "request": {
    "params": {
      "scheduled_tweet_id": 875057751231037440,
      "text": "winter solstice"
    }
  },
  "data": {
    "completed_at": null,
    "id_str": "875057751231037440",
    "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

永久删除属于当前账号的指定预排期推文。

注意:此操作为硬删除。删除后,将无法恢复删除的预排期推文。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/scheduled_tweets/:scheduled_tweet_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

scheduled_tweet_id
必需

请求中对正在操作的预排期推文的引用。

类型:long

示例:870321875435442177

请求示例

DELETE https://ads-api.twitter.com/10/accounts/18ce54d4x5t/scheduled_tweets/875064008595787776

响应示例

{
  "request": {
    "params": {
      "scheduled_tweet_id": 875064008595787776
    }
  },
  "data": {
    "completed_at": null,
    "id_str": "875064008595787776",
    "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": []
  }
}