Upgrade to Pro — share decks privately, control downloads, hide ads and more …

REST Clients Nordic APIs

masylum
October 22, 2014

REST Clients Nordic APIs

On this presentation I talk about how writing an API can help you accelerate your clients development and business development efforts.

The second half I share some patterns that we discovered while building clients for Redbooth.

masylum

October 22, 2014
Tweet

More Decks by masylum

Other Decks in Programming

Transcript

  1. • Render on the client • More Integration test •

    Backward compatibility • Coordinate API and client implementations
  2. POST /api/3/channels/9/mute HTTP/1.1 Host: redbooth.com ! { “for”: “1-hour” }

    ! Simplified Response ! {“id”: 9, “muted_until": 1413735462} !
  3. Use the Link HTTP header to tell the client to

    re-fetch a resource http://www.w3.org/wiki/LinkHeader
  4. POST /api/3/comments HTTP/1.1 Host: redbooth.com ! { “body”: “This task

    is for @bpedro” } ! Response Contains ! Link:<https://redbooth.com/api/3/tasks/ 15065399>; rel="updated" type="Task">
  5. PATCH /my/resource HTTP/1.1 Host: example.org Content-Type: application/json-patch+json ! [ {

    "op": "remove", "path": "/a/b/c" }, { "op": "add", "path": "/a/b/c", "value": "foo"}, { "op": "replace", "path": "/a/b/c", "value": 42 } ]