Getting started with the Bookmarks lookup endpoint
This quick start guide will help you make your first request to the Bookmarks lookup endpoint using Postman. Please visit our X API v2 sample code GitHub repository if you want to see sample code in different languages.Prerequisites
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:- Sign up for a developer account and receive approval.
- Create a Project and an associated developer App in the developer portal.
- Navigate to your App’s “Keys and tokens” page to generate the required credentials. Make sure to save all credentials in a secure location.
Steps to build a Bookmarks lookup request
Step one: Start with a tool or library There are several different tools, code examples, and libraries that you can use to make a request to this endpoint, but we will use the Postman tool here to simplify the process. To load the X API v2 Postman collection into your environment, please click on the following button: Once you have the X API v2 collection loaded in Postman, navigate to the “Bookmarks” folder, and select “ Bookmarks lookup”. Step two: Authenticate your request To make a successful request to this endpoint, you will need to use OAuth 2.0 Authorization Code Flow with PKCE. You can generate an access token within Postman. If you go to the tab entitled “Authorization” and select “OAuth 2.0”. In this tab, be sure to follow these steps:- Name your token
- Select the Grant Type as Authorization Code (with PKCE)
- Update the parameters: Callback URL - https://www.example.com This should be matching the callback URL you set in your auth settings page in the Developer Portal. Auth URL - https://x.com/i/oauth2/authorize Access Token URL - https://api.x.com/2/oauth2/token Client ID - Cut and paste OAuth 2.0 client ID from the Developer Portal Client Secret - Cut and paste OAuth 2.0 client ID from the Developer Portal. You will need this only if you are using an App type that is a confidential client.
- Update the scopes with the following values: post.read users.read bookmark.read
- Populate the field state with “State”
- Click where it says “Generate Token”
- Press the save icon to save the folder changes.
Key | Value |
id | 2244994945 |