To complete this guide, you will need to have a set of keys and tokens to authenticate your request. You can generate these keys and tokens by following these steps:
Load the Twitter API v2 Postman Collection
To load the Twitter API v2 Postman collection into your workspace, please click on the following button:
Authenticate your request
To make a successful request to lookup endpoints, you can use either OAuth 1.0a User Context, OAuth 2.0 App-Only, or OAuth 2.0 Authorization Code with PKCE. However, with manage endpoints, you can only authenticate with OAuth 1.0a User Context or OAuth 2.0 Authorization Code with PKCE.
Regardless, when using Postman, the default authentication keys and tokens will automatically populate in your requests as long as you've set up your environment properly.
You can do this by selecting the environment named “Twitter API v2” (in the top-right corner of Postman), and adding your keys and tokens to the "initial value" and "current value" fields (by clicking the eye icon next to the environment dropdown). These keys include the following:
- API Key (also known as Consumer Key)
- API Secret Key (also known as Consumer Secret)
- OAuth 1.0a user Access Token
- OAuth 1.0a user Access Token Secret
- OAuth 2.0 App Access Token
- OAuth 2.0 Client Key (only available if you've set up OAuth 2.0 User Authentication settings in your App's settings)
- OAuth 2.0 Client Secret (only available if you've set up OAuth 2.0 User Authentication settings in your App's settings)
Choose any of the following endpoints for a more in-depth guide once, you have completed the prerequisites: