• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
API REST for beginners or why you should make your API understandable
 

API REST for beginners or why you should make your API understandable

on

  • 250 views

A brief introduction to REST and some context for newbies in this API world we are building

A brief introduction to REST and some context for newbies in this API world we are building

Statistics

Views

Total Views
250
Views on SlideShare
237
Embed Views
13

Actions

Likes
0
Downloads
2
Comments
0

1 Embed 13

https://twitter.com 13

Accessibility

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    API REST for beginners or why you should make your API understandable API REST for beginners or why you should make your API understandable Presentation Transcript

    • API REST for beginners... ...or why I should care about building an understandable API
    • POST /hello-world Javier Lafora (@eLafo)
    • A small walk through historyA small walk through history
    • Web of documents
    • Widgets
    • Web scraping
    • SOAP
    • Mashups
    • http://cartodb.github.io/lisbon-2014/#/2/24.7/-7.0/0
    • Internet of Things
    • Internet of everything
    • Same app on multiple devices
    • http://www.mediabistro.com/alltwitter/api-billionaires-club_b11424
    • http://www.programmableweb.com/news/9000-apis-mobile-gets-serious/2013/04/30
    • http://apiux.com/2013/05/29/api-hierarchy-needs/
    • https://www.lordabbett.com/content/lordabbett/en/perspectives/equityperspectives/finding-growth-
    • http://www.zdnet.com/internet-of-things-8-9-trillion-market-in-2020-212-billion-connected-things-7000021516/
    • Dissecting an HTTP Request ● Method ● Path ● Header ● Body
    • Methods GET: Requests a representation of the specified resource POST: Requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI PUT: Requests that the enclosed entity be stored under the supplied URI PATCH: Apply partial modifications to a resource DELETE: Deletes the specified resource HEAD: Asks for the response identical to the one that would correspond to a GET request, but without the response body OPTIONS: Returns the HTTP methods that the server supports for the specified URL
    • GET request
    • POST request
    • Dissecting an HTTP response ● Status ● Header ● Body
    • HTTP response
    • http://www.slideshare.net/supercoco9/what-is-rest-why-is-it-part-of-the-rails-way-railsconf-2014-jav
    • Defining an API
    • What to do...
    • ...with what?
    • RPC What to do? In the body With what? In the body POST /rpc HTTP/1.1 Host: www.upcdatabase.com User-Agent: XMLRPC::Client (Ruby 1.8.4) Content-Type: text/xml; charset=utf-8 Content-Length: 158 Connection: keep-alive <?xml version="1.0" ?> <methodCall> <methodName>lookupUPC</methodNa me> ... </methodCall>
    • REST What to do? In the HTTP method With what? In the path GET /hello.txt HTTP/1.1 Host: www.example.com
    • REST-RPC Hybrid What to do? In the path With what? In the path GET services/rest?api_key=xxx&method=flickr.photos.search&tags=penguin HTTP/1.1 Host: www.flickr.com
    • REST (Representational State Transfer) Roy Fielding (2000) Architecture for the web
    • Resources
    • resources are not models
    • Uniform and constrained interface http://www.ibm.com/developerworks/websphere/techjournal/0903_peterson/0903_peterson.html
    • REST Principles (some)
    • Addressability
    • Addressability /bands/iron_maiden /bands/the_beatles /releases/20140529 /releases/last
    • Representation oriented
    • Statelessness
    • HATEOAS (Hypermedia as the Engine of Application State)
    • Use methods and response statuses well
    • Make your data format consistent
    • Versioning
    • https://invoicefu.com/es/developers/api_docs
    • https://developers.teowaki.com/api-overview
    • Questions?
    • aspgems.com fin Thanks