6. Real REST Examples

Here's a very partial list of service providers that use a REST API. Note that some of them also support a WSDL (Web Services) API, in addition, so you can pick which to use; but in most cases, when both alternatives are available, REST calls are easier to create, the results are easier to parse and use, and it's also less resource-heavy on your system.
So without further ado, some REST services:

  • The Google Glass API, known as "Mirror API", is a pure REST API. Here is an excellent video talk about this API. (The actual API discussion starts after 16 minutes or so.)
  • Twitter has a REST API (in fact, this was their original API and, so far as I can tell, it's still the main API used by Twitter application developers),
  • Flickr,
  • Amazon.com offer several REST services, e.g., for their S3 storage solution,
  • Atom is a RESTful alternative to RSS,
  • Tesla Model S uses an (undocumented) REST API between the car systems and its Android/iOS apps.

(This is far from an exhaustive list.)

22 comments:

dorai said...

Thank you for excellent posts on REST.

A minor update. The Yahoo Live service has been shutdown since Dec 08. So you may want to update the post to reflect that.

Dr. M. Elkstein said...

Thanks, Dorai. I've now updated the list.

in soham nia said...

Seriously, this is an amazing post on REST, solved all my doubts and more. Epic stuff. Thanks a ton!!!

Hezi said...

REST understood. At last. 10x :-)

candy said...

Thank you so much for putting together this blog explaining what REST is. It's very easy to read and understand, unlike many technical guides out there. I'm just getting started learning how to use web services and this really gives me a huge head start on understanding the concepts!

Anthony said...

Great "paper" indeed! One question on this chapter. If I click on the Yahoo link and look at the page source, I get this (pls see below); isn't this in fact xml/SOAP?

"
"

Dr. M. Elkstein said...

Anothony, whatever you posted wasn't displayed by blogger -- I suspect that's because it's all XML tags...

A REST service's response can technically be anything, including an XML/SOAP response, if that's how the authors defined it.

Redwood said...

The posted example needs to be changed - Yahoo has apparently shut down most of their APIs (as of Nov 2010), and the example link just returns a "This service has been shut down" message.

RandallIja said...

Broken links:
Twitter API and Yahoo example.

Dr. M. Elkstein said...

Dear Redwood and RandallIja,

Indeed! It seems like, in these troubled time for the company, Yahoo! no longer makes its various APIs available. I have replaced the detailed example above with a Twitter search, using Twitter's API, and completely removed Yahoo! from the list of examples.

chandan singh said...

Nice article.

Saurav Shrestha said...

Dr Elkstein,

I understand that we can use REST calls by simply constructing a URL and entering it into the browser, but I have a situation here.

What if I need to send some sort of credentials (I'm using a CMS which restricts content by user roles). I don't think I should authenticate with GET since everything is in the URL.

Right now what I'm doing is using a php script to send username/password (the server has a user login end-point) and I print out the http status message and get a 200. How can I use this fact that I just authenticated to get to the protected content? If I try to grab the content AFTER the authentication method runs, I still get a 401, so I'm guessing since REST is stateless, it's not remembering that I am authenticated.

I'm executing the php file in terminal using 'php '.

Thanks in advance. Wonderful resource you have here.

Saurav

Dr. M. Elkstein said...

Hello Saurav,

Please see the page titled "How do I handle Authentication in REST" for possible answers to your question.

Things I Think said...

On the links you posted ( for example the one labeled "this" that returns JSON) Where are you specifying that REST protocol is used as opposed to SOAP or something? Is this something you specify on the server or what? I'm confused. Thanks!

Dr. M. Elkstein said...

Nothing explicitly marks a REST request/response as such. If you've seen a SOAP request, you'll know the difference immediately...

lykoszine said...

I'm not at all sure about Atom being RESTful RSS though...

manish tiwari said...

Can U pleaase help to imlement RSET in HTML with javascript jquery and ajax

Nitesh Rijhwani said...

This is an excellent and easiest REST tutorial on web...keep up the good work.

Derek said...

Interesting that they call their interfaces 'REST'. Flickr doesn't return URLs to resources, so it fails the HATEOAS test. I wouldn't call that REST. Twitter is interesting, and I'd say it's a true REST, but they only support GET and POST.

Piloto said...

Hi Dr.Elkstein,

When I click on the twitter example, I get this error 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.

Dr. M. Elkstein said...

Hi Piloto,

You're right. It seems like Twitter had shut down their v1.0 API, and the newer API requires authentication, so providing simple links here just won't work.

Sadly, then, I had to remove the Twitter sample links from this page. Thank you for notifying me, though.

The example, BTW, was a vanity search for my name on Twitter. You can still use the website for that :-)

Satyendra Kumar said...

Thanks a lot for this amazing tutorial which helped me out to understand this hazard(REST as earlier) but not it is very soft :)

thanks again