this is an old version. new version here: http://blog.apigee.com/detail/slides_for_restful_api_design_second_edition_webinar/
It's been 10 years since Fielding first defined REST. So, where are all the elegant REST APIs? While many claim REST has arrived, many APIs in the wild exhibit arbitrary, productivity-killing deviations from true REST. We'll start with a typical poorly-designed API and iterate it into a well-behaved RESTful API.
27. Resource POST GET PUT DELETE
create read update delete
replace
create a delete all
/dogs list dogs dogs with
new dog dogs
new dogs
if exists
treat as a
update Bo
collection
/dogs/bo show Bo delete Bo
create new
if not
dog in it
create Bo
Wikipedia
28. Resource POST GET PUT DELETE
create read update delete
replace
create a delete all
/dogs list dogs dogs with
new dog dogs
new dogs
treat as a if exists
collection update Bo
/dogs/bo create show Bo delete Bo
new dog if not
in it create Bo
Wikipedia
29. Resource POST GET PUT DELETE
create read update delete
bulk
create a delete all
/dogs list dogs update
new dog dogs
dogs
if exists
update Bo
/dogs/bo error show Bo delete Bo
if not
error
Wikipedia
56. Facebook HTTP Status Code: 200
{"type":"OAuthException","message":"(#803) Some
of the aliases you requested do not exist:
foo.bar"}
Twilio HTTP Status Code: 401
{"status":401,"message":"Authenticate","code":
20003,"more_info":"http://www.twilio.com/docs/
errors/20003"}
SimpleGeo HTTP Status Code: 401
{"code":401,"message":"Authentication
Required"}
57. Code for code
200 - OK
401 - Unauthorized
http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
Message for people
{“message” : “Verbose, plain language
description of the problem with hints about
how to fix it.”
“more_info” : “http://dev.teachdogrest.com/
errors/12345”}
66. Always returns OK
/dogs?suppress_response_codes=true
Code for code ignoring
200 - OK
Message for people code
{“response_code” : “401”, “message” :
“Verbose, plain language description of the
problem with hints about how to fix it.”
“more_info” : “http://dev.teachdogrest.com/
errors/12345”, “code” : 12345}
71. Application
API Virtualization Layer
API API API
72. Be RESTful
Only 2 URLs
No verbs
Use nouns as plurals
Sweep complexity behind the ‘?’
Borrow from leading APIs
Account for exceptional clients
Add virtualization layer