tags:

views:

191

answers:

3

I read tons of posts, questions and answers on the REST vs SOAP debate. I read a few REST supporters that claim that "well designed" REST Web Services are self explanatory and hardly need any documentation.

Can anyone point me to such a Web Service? Preferably a somewhat complicated one.

+1  A: 

Here is an example of a complex API for a network video camera... I recommend looking at the VAPIX HTTP 3.0 API. It is pretty straightforward to follow, assuming you are familiar with the terms. Granted, it is about 60 pages, but much of it is just boilerplate to get the reader familiar with using a network API.

The Yahoo! Weather Feeds are an example of a simple, RESTful way to pull information from a service.

There are also examples of REST API's that essentially send XML-structured data back and forth. While these are technically REST, if you are going through the trouble to define an API using XML, I'd consider using web services.

jheddings
I don't get it. The Yahoo API is just using one resource. I don't think it is a good example of a RESTFUL WS. The network camera is using POST and GET and a few different resources but I don't think you can move one inch without the manual. I don't think it is qualified as "well defined". At least not in a way that would render REST as more straightforward than SOAP.
idophir
jon hanson
@PostalMethods: if you are looking for an API that requires no documentation to get you started, you've got a hard problem in front of you. The VAPIX API is quite well-defined, but expects some understanding of the industry. As for the Yahoo! API, it is simply an example of a well-defined API... I'm not sure why it wouldn't be a good example of a RESTful API.
jheddings
@jon hanson: I'm not an expert either... I've heard folks debate on the usage of verbs in the request line versus the HTTP action. From my understanding, it does adhere to the constraints of a RESTful API. There may be other generally-accepted principles that are debateable in the API...
jheddings
@jheddings: The Yahoo! API is just simplistic. There are no much us of resources. I'm looking for a WS that utilizes POST, GET, DELETE and PUT and also uses multiple resources (e.g., www.domain.com/userid/123123/<more resources>/)
idophir
@jheddings, why is a Rest API that defines an XML interface not considered restful? Rest is about using puts and posts to insert/update data. So you can specify that data be supplied as name/value pairs, XML, Json or whatever. No?
Marcus
@Marcus: I agree that it is RESTful, but having complex XML structure just seems to lend itself well to SOAP. And the debate about whether SOAP is RESTful goes on...
jheddings
+1  A: 

I found Netflix's documentation to be very good and help you understand what goes into designing an API. The API is not perfect, but I think it is a good combination of practical and thoughtful.

The idea of a self documenting REST API is that one can be given a single entry point into a system and be able to discover all functionality available through the returned documents, combined with understanding of standard usage of the REST verbs (GET, PUT, DELETE). So that if you pulled up a list of employees from a RESTful system, the individual entries would point to the URL of that entry and the employer field would point to the URL for the employer. Do a search on HATEOAS for more details. But you might call "/employee" on a service and get:

<employees>
  <employee id=132 name=bob url="/employee/132" employer="/employer/176"/>
  <employee id=179 name=carl url="/employee/132" employer="/employer/122"/>
</employees>

You could view the complete employee record at /employee/132 and view the record of their employer at /employer/176. By convention, if you had permission, you could update the employee bob using PUT against /employee/132 or create a new employee with a POST to /employee. The content types accepted are queryable through the interface, also (using HEAD, I believe).

Tim
A: 

Check out Amazon S3.

Gandalf