Monday, October 28, 2013

How to migrate from Twitter API version 1 to version 1.1

If you have a twitter API widget on your website using Twitter API version 1 that is no longer working, its probably because Twitter recently launched API version 1.1. The response body that you will get for API version 1 will look like "{"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}"

Now, How to migrate from Twitter API version 1 to version 1.1

The upgrade process is different for everyone. It's best to look at how you're using the API today and compare that to the documentation for API v1.1. Some API methods have changed paths. Some no longer exist. There are also newer ones. All requests require a form authentication, for which you can either useObtaining access tokens or Application-only authentication. There are docs for these topics throughout this site, but admittedly they speak mostly to programmers.
App-only auth is the easiest way to use auth with the API. It barely requires programming anything to get up and running with it.
For some developers, it really is as easy as changing paths they're using from /1/ to /1.1/. For other developers, you're going to be learning about authentication for the first time. You may find that things you were able to do in the past aren't possible anymore -- or at least aren't possible in the context that you're trying to do them.
If you're just trying to get tweets on a website, Embedded Timelines are really the best bet. If you want to do something more custom or complex, explore Twitter Libraries for a library in your preferred language.
Finally, if you already have an API-based integration with OAuth and are moving to API v1.1, keep in mind that API v1.1 is much stricter from the perspective of HTTP 1.1 and OAuth 1.0A spec compliance. They require all reserved characters to be encoded correctly. Most non-alphanumeric characters are reserved. Many libraries, including some core libraries, perform some of this encoding incorrectly. 

2 comments:

  1. I enjoyed reading this post as it gave me some great knowledge into a few things. Actually, I don’t even know what im talking about, just thanks for the post.

    click to shopping cart abandonment

    ReplyDelete
  2. This is great! i have always wanted to know where all the yummy Vegan places were and now i can easily eat out at these place or order in! thanks so much! Exit intent technology




    ReplyDelete