Posts 查询 endpoint 快速上手
构建 GET /tweets 请求的步骤
第一步:选择工具或库
第二步:对请求进行身份验证
第三步:确定并指定要检索的 Posts
1228393702244134912
。
https://x.com/TwitterDev/status/1228393702244134912
在 Postman 中,转到“Params”选项卡,在 ids 参数的“Value”列中输入该 ID,或输入以逗号分隔的一串 Post ID。
Key | Value |
---|---|
ids | 1228393702244134912,1227640996038684673,1199786642791452673 |
第四步:确定并指明要检索的 fields
id
、text
和 edit_history_tweet_ids
。
在本练习中,我们将从不同对象请求三组额外的字段:
- 在主对象中追加
tweet.created_at field
。 - 返回的 Posts 的作者所对应用户对象的默认字段:
id
、name
和username
- 在关联的用户对象中追加
user.created_at field
。
key:value
对:
Key | Value | Returned fields |
---|---|---|
tweet.fields | created_at | tweets.created_at |
expansions | author_id | includes.users.id , includes.users.name , includes.users.username |
user.fields | created_at | includes.users.created_at |