2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

POSTMANを使用したTwitter API使用

Posted at

チュートリアルを見ればすぐ出来ると思いますが、しょうもないところで迷ったのでメモ
https://developer.twitter.com/en/docs/tutorials/postman-getting-started

  1. POSTMANにユーザー登録して Twitter API v2 をフォーク
    https://www.postman.com/twitter/workspace/twitter-s-public-workspace/collection/9956214-784efcda-ed4c-4491-a4c0-a26470a67400?ctx=documentation

  2. WorkSpaceを移動して、Collectionsタブを選択、リストから Twitter API v2 を選択

  3. Typeを Bearer Token に変更、Token欄に"{"を入力してbearer_tokenを選択
    ※Saveボタンを忘れずに

  4. Variables タブを開いて、bearer_token 欄にtokenをコピー
    ※bearer_token は Developer Portal → Projects & Apps → 作成したアプリ → Keys and tokens から再生成可能

  5. Collections から使用したいAPIの"フォルダー"を選択し、Type が Inherit auth from parent になってることを確認(ここが別の認証になってて時間を潰しました泣)

  6. 適当なAPIを選択したらパラメータを入力して Send 、下のResponseに結果が表示される。401エラーが出たら、上記のTypeとTokenを再確認
    例:Tweet Lookup → Single Tweet、Paramsの PathVariables の id Key のvalueに「1228393702244134912」を入力

↓Twitter Devのツイート
https://twitter.com/TwitterDev/status/1228393702244134912

※入力したパラメータはSaveを押すと保存される、Save横の矢印を押せば別名保存できる。

2~5
スクリーンショット 2022-06-21 140709.png

6
スクリーンショット 2022-06-21 140927.png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?