Getting started with the user Post and mention timeline endpoints
This quick start guide will help you make your first request to the user Post timeline endpoint with a set of specified fields using Postman. If you would like to see sample code in different languages, please visit our X API v2 sample code GitHub repository.PrerequisitesTo 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.
XDevelopers
.
https://x.com/XDevelopers
To convert this username to the user ID, you will have to use the users lookup endpoint with the username and find the numerical user ID in the payload. In the case of @XDevelopers, the user ID is 2244994945.
In Postman, navigate to the “Params” tab and enter this user ID into the “Value” column of the id parameter.
Key | Value |
id | 2244994945 |
- The additional tweet.created_at field in the primary user objects.
- The associated authors’ user object’s default fields for the returned Posts: id, name, and username
- The additional user.created_at field in the associated user objects.
Key | Value | Returned fields |
tweet.fields | created_at | tweets.created_at |
expansions | author_id | includes.users.id , includes.users.name , includes.users.username |
user.fields | created_at | includes.users.created_at |
max_results | 5 |
https://api.x.com/2/users/:id/tweets?tweet.fields=created_at&expansions=author_id&user.fields=created_at&max_results=5
Please note:In Postman, the path parameter :id in the URL field will not automatically update to the value that you enter into the
id
params field, which is why the above URL includes :id
and not 2244994945.- oldest_id
- newest_id
- results_count
- next_token
- previous_token
Key | Value |
pagination_token | t3buvdr5pujq9g7bggsnf3ep2ha28 |