QAktM6W6DF6F7XXXXXX
QAktM6W6DF6F7XXXXXX
consumer_secret AJX560A2Omgwyjr6Mml2esedujnZLHXXXXXX
AJX560A2Omgwyjr6Mml2esedujnZLHXXXXXX
access_token 1995XXXXX-0NGqVhk3s96IX6SgT3H2bbjOPjcyQXXXXXXX
1995XXXXX-0NGqVhk3s96IX6SgT3H2bbjOPjcyQXXXXXXX
token_secret rHVuh7dgDuJCOGeoe4tndtjKwWiDjBZHLaZXXXXXX
rHVuh7dgDuJCOGeoe4tndtjKwWiDjBZHLaZXXXXXX
bearer_token AAAAAAAAAAAAAAAAAAAAAL9v6AAAAAAA99t03huuqRYg0mpYAAFRbPR3XXXXXXX
AAAAAAAAAAAAAAAAAAAAAL9v6AAAAAAA99t03huuqRYg0mpYAAFRbPR3XXXXXXX
Note that the keys and tokens used in the above table are made up and will not work if used in a request. Once you’ve added your credentials as variables and have made sure that the X API v2 environment is selected, you will be ready to make requests to the X API v2 collection. This is because each of the endpoint’s authorization tabs are set up to automatically inherit the variables from this environment. For using Postman with User Access Tokens skip XXXX to the additional details on how to do so. Step three: Select an endpoint Next step is to choose an endpoint from the collection and start to build your request. You can select an endpoint from the right-hand side navigation. Here is what this looks like: For this example, we are going to use the X API v2 > Post Lookup > Single Post endpoint. Step four: Add values to the Params tabNext step will have you navigate to the Params tab. You should see a set of inactive params with descriptions that explain what the parameter does, and a list of all of the potential values that you can pass with your request. In this example, we are going to activate the expansions and tweet.fields query parameters and add the following values: Key Value tweet.fields
created_at,attachments
expansions author_id In addition to adding the query parameters, we need to add the required Path Variable, id. Since this endpoint returns Posts, we need to add a valid Post ID as the value. You can find the Post ID by navigating to x.com and clicking on a Post, and then looking in the URL. For example, the following URL’s Post ID is 1228393702244134912
: https://x.com/XDevelopers/status/1228393702244134912
On the Params tab, scroll down past all of the query parameters to display the “Path Variables” section. We will be adding the Post ID that you would like to use as a value to the id key. If you’ve entered everything from this step correctly, the Params tab should look like the following: Step five: Send your request and review your responseNow that everything is set up in your request, you can click the “Send” button. If everything was set up properly, you should receive the following payload:
{
"data": {
"author_id": "2244994945",
"text": "What did the developer write in their Valentine’s card?\n \nwhile(true) {\n I = Love(You); \n}",
"id": "1228393702244134912",
"created_at": "2020-02-14T19:00:55.000Z"
},
"includes": {
"users": [
{
"username": "XDevelopers",
"name": "Developers",
"id": "2244994945"
}
]
}
}
Generating a User Access Token with Postman: Using OAuth 1.0a to generate a user access tokenReview the three step process used in the OAuth1.0a flow test collection. Using OAuth 2.0 to generate a user access tokenIf you want to generate an OAuth 2.0 user access token in Postman you can generate OAuth 2.0 access tokens to use in conjunction with the X API v2 Postman collection. If you click on the collection in your workspace and go to the tab entitled “Auth” and select the type to be “OAuth 2.0”. From there under the heading “Configure New Token” go to where it says “Configuration Options”. You can update the “Grant Type” to “Authorization Code (With PKCE)”. You will want to update your Callback URL to match the callback url associated with your application. Additionally, you will want to update the following parameters:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4