Manage Retweets: Standard v1.1 compared to X API v2
If you have been working with the standard v1.1 POST statuses/retweet/:id, and POST statuses/unretweet/:id endpoints, the goal of this guide is to help you understand the similarities and differences between the standard and X API v2 Retweets endpoints.
- Similarities
- Authentication
- Differences
- Endpoint URLs and HTTP methods
- Request limitations
- App and Project requirements
- Request parameters
Similarities
Authentication
Both the standard v1.1 and X API v2 manage Retweets (POST statuses/retweet/:id, and POST statuses/unretweet/:id) endpoints use OAuth 1.0a User Context. Therefore, if you were previously using one of the standard v1.1 Retweets lookup endpoints, you can continue using the same authentication method if you migrate to the X API v2 version.
Differences
Endpoint URLs and HTTP methods
- Standard v1.1 endpoints:
- https://api.x.com/1.1/statuses/retweet/:id.json
(Retweets a Post. Returns the original Post with Retweet details embedded) - https://api.x.com/1.1/statuses/unretweet/:id.json
(Undo a Retweet. Returns the original Post with Retweet details embedded)
- https://api.x.com/1.1/statuses/retweet/:id.json
- X API v2 endpoint:
- https://api.x.com/2/tweets/:id/retweets
(Retweets a given Post) - https://api.x.com/2/users/:id/retweets/:source_tweet_id
(Undo a Retweet of a given Post)
- https://api.x.com/2/tweets/:id/retweets
App and Project requirements
The X API v2 endpoints require that you use credentials from a developer App that is associated to a Project when authenticating your requests. All X API v1.1 endpoints can use credentials from standalone Apps or Apps associated with a Project.
Request parameters
The following standard v1.1 request parameters accepted two request query parameters (user_id or screen_name). The X API v2 only accepts the numerical user ID, and it must be passed as part of the endpoint path.
Standard v1.1 | X API v2 |
---|---|
id | id |
includes_entities | No equivalent |
Please note that the Standard v1.1 parameters are passed as query parameters, whereas the X API v2 parameters are passed as body parameters for the POST endpoint or path parameters for the DELETE endpoint.
Also, an id of the user Retweeting a Post is not required when using the standard v1.1 endpoints since the Access Tokens passed with OAuth 1.0a User Context infer which user is initiating the Retweet/undoing a Retweet.