注意: このガイドは、クイックスタート概要の前提条件を完了済みであることを前提としています。
ピン留めされた List ルックアップリクエストを作成する手順
- users lookup の username エンドポイントを使用して、username を渡すと id フィールドが返されます。
- Access Token を確認すると、数値部分がご自身のユーザー ID です。
id パラメータの “Value” 列に入力します。
| Key | Value |
id | 2244994945 (user ID) |
id と name が返されます。
id と name 以外の追加の fields を受け取りたい場合は、リクエストで fields および/または expansions パラメータを指定する必要があります。
この演習では、異なるオブジェクトから3つの追加の fields セットをリクエストします。
- 主となる List オブジェクトの追加フィールド
follower_count。 - expansions パラメータを使用した user object の完全版。
- 関連するユーザーオブジェクトの追加フィールド
tweet.created_at。
| Key | Value | Returned fields |
| list.fields | follower_count | follower_count |
| expansions | owner_id | includes.users.id, <br/>includes.users.name, <br/>includes.users.username |
| user.fields | created_at | includes.users.created_at |
https://api.x.com/2/users/2244994945/pinned_lists?expansions=owner_id&list.fields=follower_count&user.fields=created_at
ステップ4:リクエストを送信してレスポンスを確認
セットアップが完了したら、“Send” ボタンを押すと、次の例に類似したレスポンスが返されます。