Skip to content

Latest commit

 

History

History
61 lines (50 loc) · 1.08 KB

File metadata and controls

61 lines (50 loc) · 1.08 KB

createXTweet

发送推文或回复。

请求

  • Method: POST
  • URL: https://x.com/i/api/graphql/{CreateTweet}/CreateTweet
  • Query ID: CreateTweet
  • Header: 需要 x-client-transaction-id

Body

{
  "variables": {
    "tweet_text": "hello",
    "reply": {
      "in_reply_to_tweet_id": "optional tweet id",
      "exclude_reply_user_ids": []
    },
    "attachment_url": "optional quote url",
    "media": {
      "media_entities": [
        {
          "media_id": "media id",
          "tagged_users": []
        }
      ],
      "possibly_sensitive": false
    },
    "semantic_annotation_ids": [],
    "disallowed_reply_options": null,
    "semantic_annotation_options": {
      "source": "Unknown"
    }
  },
  "features": {},
  "queryId": "c50A_puUoQGK_4SXseYz3A"
}

返回数据

成功时常见结果:

{
  "rest_id": "tweet id",
  "core": {},
  "legacy": {
    "full_text": "hello"
  }
}

如果 X 返回结构变化,请以实际响应为准。

风险

这是写入接口。测试脚本默认 dry-run,必须加 --execute 才会真实发送。