RESTful Design at     Work      Tom Marrs       Architect
Your ProfileHow?       What?          Where?
What’s The Point?InterfaceDesignMatters
Our Agenda                 RESTful Web     Well-RESTful Web                               RESTful                   Servic...
We’re Not Covering        :(-SecurityLots of CodeSOADesign Patterns
RESTful Design BestPractices - Roadmap
Determine Data SetBusiness ContextRequirementsModels
Our Case Study -   Mentoring Program  A Relationship6 meetingsFace-to-face or PhoneMentoring Checklist
Mentoring Program -   User Stories
Discover Resources      Type                         ExampleThings         Order, Member, ProductAssociations   Enrollment...
Design Resources
Uniform Interface -HTTP Methods/VerbsHTTP Verb/                Action Method   GET            Read   POST      Create [Upd...
HTTP Status Codes -     Typical  HTTP Verb/   HTTP Status                                  Meaning   Method        CodeGET...
HTTP Status Codes -      Other                      HTTP   HTTP Verb/                      Status                Meaning  ...
Design URIs
Of Nouns and VerbsNouns - GoodVerbs - Bad
Verbs - Really Bad!/listPairs/reviewPairStatus/deletePair/updateProgress.../getAvgWaitTimeForMember - Really??/provideMemb...
Of Nouns andVerbs ... Cont’d
Use Parameters -Simplify AssociationsBefore (Update Progress)/pairs/{pairId}/mentor/{mentorId}After (Update Progress)/pair...
Pagination      API              Pagination ParamsFacebook      ?offset=100&limit=25Twitter       ?page=5&rpp=25LinkedIn  ...
SearchingGlobal/search?q=Fred+SmithScoped/search/mentors/32/feedback/q?=leader
Versioning         API                   Sample URITwilio           /2012-07-11/Accounts/{AccountSid}SalesForce.com   /ser...
Versioning ... Cont’d          Change                        Don’t ChangeDeleted / Renamed Resources New Resources        ...
Content NegotiationFormat               HTTP Request         Accept Header - application/json JSON         simplytoast.api...
Error HandlingHTTP Status CodesError Messages?
Error Messages?      Why or Why Not?{  "status" : {    "user" : {       "message" : "Member Fred Smith already exists."   ...
JSON Object Design   - JSONPad
How to Spot a Hybrid
Reddit
Flickr
Flickr API Call http://api.flickr.com/services/rest/?method=flickr.cameras.getBrandModels&brand=canon&format=json&nojsonca...
Delicious
RESTful Web Service Design GuidelinesAlfrescoApigeeAtlassian
Alfresco
Apigee
Atlassian
Well-Designed     RESTful APIsTwitterLinkedInOpen LibraryTwilio
LinkedIn - People
Twilio - Send SMS
REST API Sources -ProgrammableWeb
REST API Sources -ProgrammableWeb
REST API Sources - BART API Docs
REST API Sources -  BART ETA API
REST API Sources - BART-RESTClient
Other RESTful APIsGrouponGitHub
Roll Your OwnRESTful API - Dyson
Our Agenda                 RESTful Web     Well-RESTful Web                               RESTful                   Servic...
What’s The Point?InterfaceDesignMatters
Questions?Tom MarrsArchitectthomasamarrs@comcast.nethttp://www.linkedin.com/in/TomMarrsTwitter: @TomMarrsSkype: t.marrs
RESTful API             ResourcesTeach a Dog to REST - http://blog.apigee.com/detail/restful_api_design/Apigee API Best Pr...
RESTful GroupsAPI Craft - http://groups.google.com/group/api-craft/topicsREST Discuss - http://tech.groups.yahoo.com/group...
REST in Practice
RESTful Web  Services
RESTful WebServices Cookbook
REST API Design  Handbook
RESTful Java with   JAX-RS
REST API Design   Rulebook
Upcoming SlideShare
Loading in...5
×

Restful design at work v2.0

1,490

Published on

Slides for Tom Marrs BJUG talk on 2/12/2013. See http://boulderjug.org/2013/01/tuesday-february-12-2013-a-night-with-tom-marrs-covering-json-and-rest.html

Published in: Entertainment & Humor
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,490
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
72
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Restful design at work v2.0

  1. 1. RESTful Design at Work Tom Marrs Architect
  2. 2. Your ProfileHow? What? Where?
  3. 3. What’s The Point?InterfaceDesignMatters
  4. 4. Our Agenda RESTful Web Well-RESTful Web RESTful Service Designed Service API Design RESTfulBest Practices Sources Guidelines APIs
  5. 5. We’re Not Covering :(-SecurityLots of CodeSOADesign Patterns
  6. 6. RESTful Design BestPractices - Roadmap
  7. 7. Determine Data SetBusiness ContextRequirementsModels
  8. 8. Our Case Study - Mentoring Program A Relationship6 meetingsFace-to-face or PhoneMentoring Checklist
  9. 9. Mentoring Program - User Stories
  10. 10. Discover Resources Type ExampleThings Order, Member, ProductAssociations Enrollment, Membership, Marriage, EmploymentProcesses Onboarding, Underwriting, MentoringFunctions Driving Directions, Search
  11. 11. Design Resources
  12. 12. Uniform Interface -HTTP Methods/VerbsHTTP Verb/ Action Method GET Read POST Create [Update] PUT Update [Create] DELETE Delete
  13. 13. HTTP Status Codes - Typical HTTP Verb/ HTTP Status Meaning Method CodeGET 200 OKGET 404 Not FoundPOST 201 CreatedPUT 200 OKPUT 404 Not FoundPUT 409 ConflictDELETE 200 OKDELETE 404 Not FoundDELETE 409 Conflict
  14. 14. HTTP Status Codes - Other HTTP HTTP Verb/ Status Meaning Method CodePOST / PUT / DELETE 202 Accepted - Process request laterPOST / PUT / DELETE 204 No ContentGET / PUT / DELETE 301 Moved PermanentlyALL 400 Bad RequestALL 401 UnauthorizedALL 500 Internal Server Error
  15. 15. Design URIs
  16. 16. Of Nouns and VerbsNouns - GoodVerbs - Bad
  17. 17. Verbs - Really Bad!/listPairs/reviewPairStatus/deletePair/updateProgress.../getAvgWaitTimeForMember - Really??/provideMemberFeedback/provideMentorFeedback
  18. 18. Of Nouns andVerbs ... Cont’d
  19. 19. Use Parameters -Simplify AssociationsBefore (Update Progress)/pairs/{pairId}/mentor/{mentorId}After (Update Progress)/pairs/{pairId}?mentor={mentorId}
  20. 20. Pagination API Pagination ParamsFacebook ?offset=100&limit=25Twitter ?page=5&rpp=25LinkedIn ?start=100&count=25Recommended /members?offset=100&limit=25
  21. 21. SearchingGlobal/search?q=Fred+SmithScoped/search/mentors/32/feedback/q?=leader
  22. 22. Versioning API Sample URITwilio /2012-07-11/Accounts/{AccountSid}SalesForce.com /services/data/v20.0/sobjects/ AccountFacebook ?v=1.0Recommended /v2/members
  23. 23. Versioning ... Cont’d Change Don’t ChangeDeleted / Renamed Resources New Resources New HTTP MethodsRemoved HTTP MethodsDifferent Data (same URI) New Data Formats New Attributes / Data Elements
  24. 24. Content NegotiationFormat HTTP Request Accept Header - application/json JSON simplytoast.api/members/243.json Accept Header - application/xml XML simplytoast.api/members/243.xml
  25. 25. Error HandlingHTTP Status CodesError Messages?
  26. 26. Error Messages? Why or Why Not?{ "status" : { "user" : { "message" : "Member Fred Smith already exists." }, "dev" : { "code" : 409, "message" : "Member exists. Only a DELETE or UPDATE ispossible at this point." } }}
  27. 27. JSON Object Design - JSONPad
  28. 28. How to Spot a Hybrid
  29. 29. Reddit
  30. 30. Flickr
  31. 31. Flickr API Call http://api.flickr.com/services/rest/?method=flickr.cameras.getBrandModels&brand=canon&format=json&nojsoncallback=1
  32. 32. Delicious
  33. 33. RESTful Web Service Design GuidelinesAlfrescoApigeeAtlassian
  34. 34. Alfresco
  35. 35. Apigee
  36. 36. Atlassian
  37. 37. Well-Designed RESTful APIsTwitterLinkedInOpen LibraryTwilio
  38. 38. LinkedIn - People
  39. 39. Twilio - Send SMS
  40. 40. REST API Sources -ProgrammableWeb
  41. 41. REST API Sources -ProgrammableWeb
  42. 42. REST API Sources - BART API Docs
  43. 43. REST API Sources - BART ETA API
  44. 44. REST API Sources - BART-RESTClient
  45. 45. Other RESTful APIsGrouponGitHub
  46. 46. Roll Your OwnRESTful API - Dyson
  47. 47. Our Agenda RESTful Web Well-RESTful Web RESTful Service Designed Service API Design RESTfulBest Practices Sources Guidelines APIs
  48. 48. What’s The Point?InterfaceDesignMatters
  49. 49. Questions?Tom MarrsArchitectthomasamarrs@comcast.nethttp://www.linkedin.com/in/TomMarrsTwitter: @TomMarrsSkype: t.marrs
  50. 50. RESTful API ResourcesTeach a Dog to REST - http://blog.apigee.com/detail/restful_api_design/Apigee API Best Practices - http://blog.apigee.com/taglist/restfulrapi_doc - http://blogs.burnsidedigital.com/2011/12/generating-api-documentation-with-rapi_doc/RESTdoclet - https://github.com/IG-Group/RESTdocletAPI Evangelist - http://apievangelist.com/The Programmable Web (API Directory) - http://www.programmableweb.com/apisStormpath - http://www.stormpath.com/blog/designing-rest-json-apis
  51. 51. RESTful GroupsAPI Craft - http://groups.google.com/group/api-craft/topicsREST Discuss - http://tech.groups.yahoo.com/group/rest-discuss/
  52. 52. REST in Practice
  53. 53. RESTful Web Services
  54. 54. RESTful WebServices Cookbook
  55. 55. REST API Design Handbook
  56. 56. RESTful Java with JAX-RS
  57. 57. REST API Design Rulebook
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×