views:

1429

answers:

8

Dear lazyweb,

In your opinion what are examples of good REST API implementation when evaluated based on

  1. consistency with the REST philosophy
  2. compliance with web standards
  3. just plain good software engineering

In a previous question, some names were thrown about, namely Amazon S3 & flickr.

A: 

Amazon S3 and Flickr are certainly a great start.

rails certainly has a great paradigm for building your own restful services.

EDIT: read comments below, certainly arguable that flickr isn't that great of an example.

Keith Fitzgerald
For one thing, flickr does not use HTTP status codes. It's always returning 200 OK. And furthermore if you ask for JSON response, it returns it as text/plain, and not application/json.
ashitaka
I don't think the Flickr API is a good example of a REST API. The URIs are full of method names (e.g. *getFullToken, getList, postPhoto*). This looks rather RPC-like to me.A RESTful API would looke someting like this: GET /fulltoken, GET /, POST /photos/
8jean
@8jean that is an excellent point and i fully agree with you.
Keith Fitzgerald
Mark Renouf
Flickr isn't REST. Don't believe their marketing hype.
Wahnfrieden
Flickr is not only no great example, it is no example at all.
+2  A: 

I would get a copy of RESTful Web Services. He/they go over many of the popular web services into detail about how RESTy they are.

kenny
+8  A: 

I've asked the same question a couple of weeks ago. I really advise you to have a look at the Atom Publishing Protocol as well as the Google Data Api Protocol which is based on the previous one.

Milan Novota
+2  A: 

Flickr isn't REST at all. Here's a quote from Roy Fielding: "Flickr obviously don’t have a clue what REST means since they just use it as an alias for HTTP. Perhaps that is because the Wikipedia entry is also confused. I don’t know."

Wahnfrieden
A: 

Rackspace Cloud API is pretty consistent with the standards too.

Langali
Same old XML/JSON over HTTP. This is not REST folks.
Darrel Miller
Darrel, can you elaborate on how the Sun Cloud API is a good example and Rackspace Could API is not REST at all?
Langali
As I point out above as well Darrel, Sun's API exposes many RPC like concepts so I'm not sure why you hold it up as a shining example.
jkp
A: 

Blinksale's API is a great example.

Avi Flax
It is good that Blinksale uses specific media types, but they seem to ignore hypermedia. Any REST API where the documentation starts with a list of URLs is a clear sign that they are missing some of the key goals of REST.
Darrel Miller
I disagree; I think that (1) being oriented around resources, and (2) providing and accepting representations of resources, are the two most important aspects of REST, by far. Hypermedia is important and valuable, but a system shouldn't be considered non-RESTful just because its documentation isn't structured according to hypermedia concepts. It may simply be a flaw in the documentation, and not in the actual implementation. And I think it's understandable for someone to orient their documentation around concrete URLs; many people have trouble connecting to abstract concepts.
Avi Flax
You may disagree but you would be wrong according to the guy who invented the term REST. "REST APIs must be hypertext driven" http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
Darrel Miller
If you document your API around concrete URLs, developers will embed those URLs into the client application and you will loose the loose coupling effect of REST that allows RESTful interfaces to evolve over time. i.e. You defeat one of the primary goals. Imagine if web browsers came with specific site URLs hardcoded into them. (Let's not talk about favicon eh!)
Darrel Miller
A: 

Yammer

pbreitenbach
Yammer ignores hypermedia and uses generic media types when it is expecting clients to access specific information from those documents. This will create a highly coupled client application.
Darrel Miller
+1  A: 

The Sun Cloud API is a good example.

Darrel Miller
I'd like someone to clear up how Sun get to be the poster-child when they provide resources with URL's like ""/vdc/m~FW01/ops/attach": that's RPC in disguise isn't it?!
jkp
Because REST says nothing about what an URL should look like. You cannot identify if something is RPC by looking at the URI.
Darrel Miller