Standard v1.1 compared to Twitter API v2

If you have been working with the standard v1.1 POST statuses/update and POST statuses/destroy/:id endpoints, the goal of this guide is to help you understand the similarities and differences between the standard and Twitter API v2 manage Tweets endpoints.

  • Similarities
    • Authentiation
  • Differences
    • Endpoint URLs
    • App and Project requirements
    • Request parameters

 

Similarities

Authentication

Both the standard v1.1 and Twitter API v2 manage Tweets (POST statuses/update and POST statuses/destroy/:id) endpoints use OAuth 1.0a User Context. Therefore, if you were previously using one of the standard v1.1 endpoints, you can continue using the same authentication method if you migrate to the Twitter API v2 version. 

 

Differences

Endpoint URLs

  • Standard v1.1 endpoints:
    • https://api.twitter.com/1.1/statuses/update.json
      (Creates a Tweet)
    • https://api.twitter.com/1.1/statuses/destroy/:id.json
      (Deletes a Tweet)
  • Twitter API v2 endpoint:
    • https://api.twitter.com/2/tweets
      (Creates a Tweet)
    • https://api.twitter.com/2/tweets/:id
      (Deletes a specified Tweet)

 

App and Project requirements

The Twitter API v2 endpoints require that you use credentials from a developer App that is associated with a Project when authenticating your requests. All Twitter 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 Twitter API v2 only accepts the numerical Tweet ID for the DELETE endpoint, and it must be passed as part of the endpoint path.

For the POST endpoint, additional parameters will need to be passed in via the JSON body of the request. You can learn more about what parameters are available in the API reference guide.

Next steps