Getting down some API basics

Once again, a lot of this comes from the code academy course on using the twitter api I’m working on, I’m rewriting it and adding my occasional comments to help with my understanding.

API stands for Application Programming Interface, and is like a coding contract, specifying the ways a program can interact with an application. So if you wanted to write a program that reads and analyzes data from Twitter, you’d have to use Twitter’s API. It specifies things such as the process for authentication, important URL’s, classes, methods, etc.

For an API (or any web service) to be considered RESTful, it must do the following.

  1. Separate the client from the server
  2. Not hold state between requests. This is confusing to me, but code academy defines it as: all the information necessary to respond to a client request is available in each individual request. No data, or state (which is like a page on a website) is held by the server from request to request. I think this makes sense. Otherwise, the server would need to keep track of that, and if a lot of people were using your API, you’d have a lot of work to do. This let’s a lot of people use it without you having to do anything.
  3. Use HTTP and HTTP methods (like GET, POST, DELETE and PUT). These are the “verbs” mentioned in my earlier API blog post.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s