Web APIs World    Michele Zonca
Application Programming Interface  A set of rules and specificationsfollowed by software programs to          communicate ...
Which kind of Software?●   Applications●   Libraries●   Programming Languages●   Operating Systems                   Every...
Communication?●   Send/receive low-level signals●   Ask access to resources●   Define object and classes●   Query remote d...
Lets talk about Web!●   A W3C working group to create Web Services●   Backed by big companies●   Early 2000●   A complete ...
Too complex!!       Lets try something            different..            Kings Of Code, Sept 19, 2011 Amsterdam
Welcome to the Jungle               Kings Of Code, Sept 19, 2011 Amsterdam
Representational State Transfer●   Term created by Roy Fielding in his Doctoral    Dissertation, 2000●   Deep use of HTTP ...
REST Constraints●   Client-Server (not only HTTP)    ●   Uniform interface●   Stateless●   Cacheable●   Layered System    ...
Resource Oriented Architecture●   Collection of resources    /resources●   Resource    /resources/id                      ...
Methods - ActionsPOST            CREATEGET             READPUT             UPDATEDELETE          DELETE      (Are you usin...
Adoption      image from programmableweb            Kings Of Code, Sept 19, 2011 Amsterdam
Representational State Transfer     Order in the Jungle?                     Kings Of Code, Sept 19, 2011 Amsterdam
NO!●   Bad/Partial implementations●   Lack of constraints●   Interpretation●   BTW, is not so simple                      ...
Formathttp://website.com/resources/id.xmlhttp://website.com/resources/id.json BAD! Isnt it the same resource?             ...
Use the Accept header, Luke!               ●   Used to specify                   acceptable media                   types ...
Format●   Twitter: extension (.json, .xml)●   Github: JSON●   Facebook Graph API: JSON●   Twilio: default XML, (extension ...
Searching●   Global    /search?q=search+parameters●   Scoped    /resources/search?q=search+parameters                     ...
Searching●   Twitter    ●   global = tweets → /search?q=    ●   scoped for users search → /users/search?q=●   Facebook Gra...
Results Pagination●   Linkedin: start + count●   Github: page + per_page●   Twilio: Page + PageSize●   Twitter: page + rpp...
Versioning         URL              ACCEPT Header/v1/resources/id        Best solution for customisnt the same            ...
Errors●   SOAP: HTTP code 200 and error message in    envelops body (FAULT element)●   REST: HTTP codes + message    Warni...
Authentication    Stateless: auth per call, not session-based●   ApiKey over HTTPS●   BasicHTTP Authentication●   ApiKey t...
Authentication●   Github: OAuth 2 / Basic HTTP / Basic HTTP with    token●   Twitter: OAuth 1.0a●   Facebook Graph API: OA...
So, what should I use?SCENARIOSCENARIOSCENARIO                  Kings Of Code, Sept 19, 2011 Amsterdam
So you have your API..      Now??                Kings Of Code, Sept 19, 2011 Amsterdam
Money●   Its hard to monetize    API●   API = Product? A    growing market!●   API as viral strategy●   Is there a “one si...
Monetization           Kings Of Code, Sept 19, 2011 Amsterdam
Today●   At Mashape, we believe this is todays best paradigm                                       Kings Of Code, Sept 19,...
Tomorrow?We strongly believe “revenue sharing” model will be                       huge●   Its a win-win●   APIs distribut...
Questions ? Thanks for coming! e: mike@mashape.com t: @shatsar                 Kings Of Code, Sept 19, 2011 Amsterdam
Upcoming SlideShare
Loading in...5
×

Web API's World

5,521

Published on

An overview of current Web API's world, with standards, styles, best practices and monetization paradigms

Kings of Code conference, 19 Sept 2011, Amsterdam

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,521
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
29
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide

Web API's World

  1. 1. Web APIs World Michele Zonca
  2. 2. Application Programming Interface A set of rules and specificationsfollowed by software programs to communicate Kings Of Code, Sept 19, 2011 Amsterdam
  3. 3. Which kind of Software?● Applications● Libraries● Programming Languages● Operating Systems Every! Kings Of Code, Sept 19, 2011 Amsterdam
  4. 4. Communication?● Send/receive low-level signals● Ask access to resources● Define object and classes● Query remote data● Integrate functionalities Kings Of Code, Sept 19, 2011 Amsterdam
  5. 5. Lets talk about Web!● A W3C working group to create Web Services● Backed by big companies● Early 2000● A complete standard ● How to discover (UDDI) ● How to describe (WSDL) ● How to serialize data (SOAP) Kings Of Code, Sept 19, 2011 Amsterdam
  6. 6. Too complex!! Lets try something different.. Kings Of Code, Sept 19, 2011 Amsterdam
  7. 7. Welcome to the Jungle Kings Of Code, Sept 19, 2011 Amsterdam
  8. 8. Representational State Transfer● Term created by Roy Fielding in his Doctoral Dissertation, 2000● Deep use of HTTP ● HTTP Verbs ● Status codes ● URLs● Not a standard but a style, a set of constraints Kings Of Code, Sept 19, 2011 Amsterdam
  9. 9. REST Constraints● Client-Server (not only HTTP) ● Uniform interface● Stateless● Cacheable● Layered System Kings Of Code, Sept 19, 2011 Amsterdam
  10. 10. Resource Oriented Architecture● Collection of resources /resources● Resource /resources/id Kings Of Code, Sept 19, 2011 Amsterdam
  11. 11. Methods - ActionsPOST CREATEGET READPUT UPDATEDELETE DELETE (Are you using PUTs?) Kings Of Code, Sept 19, 2011 Amsterdam
  12. 12. Adoption image from programmableweb Kings Of Code, Sept 19, 2011 Amsterdam
  13. 13. Representational State Transfer Order in the Jungle? Kings Of Code, Sept 19, 2011 Amsterdam
  14. 14. NO!● Bad/Partial implementations● Lack of constraints● Interpretation● BTW, is not so simple Kings Of Code, Sept 19, 2011 Amsterdam
  15. 15. Formathttp://website.com/resources/id.xmlhttp://website.com/resources/id.json BAD! Isnt it the same resource? Kings Of Code, Sept 19, 2011 Amsterdam
  16. 16. Use the Accept header, Luke! ● Used to specify acceptable media types for the response ● RFC 2616, HTTP 1.1 ● Its hard to test in a browser Kings Of Code, Sept 19, 2011 Amsterdam
  17. 17. Format● Twitter: extension (.json, .xml)● Github: JSON● Facebook Graph API: JSON● Twilio: default XML, (extension .json, .csv, .html)● Foursquare: JSON● Stack Overflow: JSON Kings Of Code, Sept 19, 2011 Amsterdam
  18. 18. Searching● Global /search?q=search+parameters● Scoped /resources/search?q=search+parameters Kings Of Code, Sept 19, 2011 Amsterdam
  19. 19. Searching● Twitter ● global = tweets → /search?q= ● scoped for users search → /users/search?q=● Facebook Graph API ● global → /search?q= ● scoped via “type” parameter → /search? q=..&type=user● Linkedin: by fields → ?keywords=..&last-name.. Kings Of Code, Sept 19, 2011 Amsterdam
  20. 20. Results Pagination● Linkedin: start + count● Github: page + per_page● Twilio: Page + PageSize● Twitter: page + rpp● Facebook: offset + limit● StackOverflow: page + pagesize Kings Of Code, Sept 19, 2011 Amsterdam
  21. 21. Versioning URL ACCEPT Header/v1/resources/id Best solution for customisnt the same formats:resource available at/v2/resources/id ? Accept: application/vnd.mycomp any.myapp-v2+xml Kings Of Code, Sept 19, 2011 Amsterdam
  22. 22. Errors● SOAP: HTTP code 200 and error message in envelops body (FAULT element)● REST: HTTP codes + message Warning: HTTP Codes could be intercepted and handled by your client Kings Of Code, Sept 19, 2011 Amsterdam
  23. 23. Authentication Stateless: auth per call, not session-based● ApiKey over HTTPS● BasicHTTP Authentication● ApiKey to get token● OAuth (buzzword but not always the right solution) Kings Of Code, Sept 19, 2011 Amsterdam
  24. 24. Authentication● Github: OAuth 2 / Basic HTTP / Basic HTTP with token● Twitter: OAuth 1.0a● Facebook Graph API: OAuth 2● SimpleGeo: OAuth / JSONP Tokens Kings Of Code, Sept 19, 2011 Amsterdam
  25. 25. So, what should I use?SCENARIOSCENARIOSCENARIO Kings Of Code, Sept 19, 2011 Amsterdam
  26. 26. So you have your API.. Now?? Kings Of Code, Sept 19, 2011 Amsterdam
  27. 27. Money● Its hard to monetize API● API = Product? A growing market!● API as viral strategy● Is there a “one size fits all” monetization paradigm? Kings Of Code, Sept 19, 2011 Amsterdam
  28. 28. Monetization Kings Of Code, Sept 19, 2011 Amsterdam
  29. 29. Today● At Mashape, we believe this is todays best paradigm Kings Of Code, Sept 19, 2011 Amsterdam
  30. 30. Tomorrow?We strongly believe “revenue sharing” model will be huge● Its a win-win● APIs distribution problem solved?● CEO of Indeed.com: “We tried charging for our API without much success. Then we paid developers to use it and it took off.” Kings Of Code, Sept 19, 2011 Amsterdam
  31. 31. Questions ? Thanks for coming! e: mike@mashape.com t: @shatsar Kings Of Code, Sept 19, 2011 Amsterdam
  1. A particular slide catching your eye?

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

×