1. XML is the base of the Twitter API - Twitter API is heavily based on XML. Almost all the API calls return some data in XML format (either plain XML, Atom or RSS). Therefore a good knowledge of what is XML and how to use it in your programming language of choice is a must.
2. JSON is also available - For the most API calls the returned data can be obtained in JSON format too, so if you are used to this instead of XML, then you can apply it to the fullest. I had some troubles using JSON in .NET (there are several calls that only return JSON data), but there are third-party libraries that will help you out on that.
3. Nowhere without HTTP requests - The vast majority of API calls relies on different HTTP requests (GET, POST and DELETE). Therefore, you should have a good understanding on how those work and how to apply those to get and post information.
4. MIME Types - That's yet another thing you should be familiar with. Some request need to be sent with form data, while other ones need to contain raw multipart data to be correctly processed. Same refers to images. Basically, the only MIME types I was using were application/x-www-form-urlencoded, multipart/form-data and various image types (JPEG, PNG and GIF).
5. Use custom classes - Twitter API calls return a lot of XML/JSON data and you need to somehow store and process it. My first thought was about using arrays, but then I figured that this wasn't the most efficient solution in this case. Create custom classes with settable fields that will store the returned data. Be sure, that you will use the same class more than once.
6. The original Twitter API Documentation is not the limit - There are not too many web sites out there to explain you how to buid the Twitter API calls in your language and sometimes you might see that you cannot implement a call. What to do in this case? Just leave it like this? Nope. Ask the pros and Twitter API developers on Twitter Development Talk. That group is rather useful when you are stuck on something and it can give you some help on implementing the call.
7. Basic Authentication is not there for long - Many of those who study the Twitter API use the basic authentication methods. However, it is not going to be there for long according to Twitter developers. It is steadily replaced with OAuth and if you want to register your application, you will need to implement OAuth authorization to send the unique application token.
8. Many API calls require authentication - Make sure the end user provides the needed credentials to use that specific API call. It is not that hard to implement two additional method arguments that will ask for the username and password.
9. Know the HTTP response codes - Take a look at this list of HTTP response codes. This is very helpful when a API call is unsuccessful and you have to figure out what happned. On a sidenote, always get the raw HTTP response to see the actual error.
10. Watch for API updates - Sometimes, the API updates come unexpected and the whole block of API calls in your application might not work. For example, a while ago Twitter introduced the Expect 100-Continue header and it is still required to perform HTTP requests. The best way to keep in touch with the updates is to regularly watch the Twitter API Documentation Wiki page (especially the Recent Activity section).
Everything in this post comes from my own experience with building a DLL that is a Twitter API wrapper. If anyone else wants to add some piece of advice, they are more than welcome to do so.

New Topic/Question
Reply


MultiQuote






|