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.)
Thank you for excellent posts on REST.
ReplyDeleteA minor update. The Yahoo Live service has been shutdown since Dec 08. So you may want to update the post to reflect that.
Thanks, Dorai. I've now updated the list.
ReplyDeleteSeriously, this is an amazing post on REST, solved all my doubts and more. Epic stuff. Thanks a ton!!!
ReplyDeleteREST understood. At last. 10x :-)
ReplyDeleteThank 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!
ReplyDeleteGreat "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?
ReplyDelete"
"
Anothony, whatever you posted wasn't displayed by blogger -- I suspect that's because it's all XML tags...
ReplyDeleteA REST service's response can technically be anything, including an XML/SOAP response, if that's how the authors defined it.
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.
ReplyDeleteBroken links:
ReplyDeleteTwitter API and Yahoo example.
Dear Redwood and RandallIja,
ReplyDeleteIndeed! 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.
Nice article.
ReplyDeleteDr Elkstein,
ReplyDeleteI 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
Hello Saurav,
ReplyDeletePlease see the page titled "How do I handle Authentication in REST" for possible answers to your question.
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!
ReplyDeleteNothing explicitly marks a REST request/response as such. If you've seen a SOAP request, you'll know the difference immediately...
ReplyDeleteI'm not at all sure about Atom being RESTful RSS though...
ReplyDeleteCan U pleaase help to imlement RSET in HTML with javascript jquery and ajax
ReplyDeleteThis is an excellent and easiest REST tutorial on web...keep up the good work.
ReplyDeleteInteresting 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.
ReplyDeleteHi Dr.Elkstein,
ReplyDeleteWhen 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.
Hi Piloto,
ReplyDeleteYou'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 :-)
Thanks a lot for this amazing tutorial which helped me out to understand this hazard(REST as earlier) but not it is very soft :)
ReplyDeletethanks again
FYI, that Amazon S3 Storage URL you've got listed is broken.
ReplyDeleteHi Juz, I've fixed the URL. Thanks!
ReplyDeleteTwitter isn't a REST API. See Roy Fielding's post, to wit: "A REST API should be entered with no prior knowledge beyond the initial URI (bookmark) and set of standardized media types that are appropriate for the intended audience (i.e., expected to be understood by any client that might use the API). From that point on, all application state transitions must be driven by client selection of server-provided choices that are present in the received representations or implied by the user’s manipulation of those representations. The transitions may be determined (or limited by) the client’s knowledge of media types and resource communication mechanisms, both of which may be improved on-the-fly (e.g., code-on-demand). "
ReplyDeleteAnd yet, look at Twitter's documentation for their "REST" API - it's a list of URIs!