designing a hypermedia api with grape & roar
DESCRIPTION
Given at API Craft NYC, http://www.meetup.com/API-Craft-NYC/events/209294892/TRANSCRIPT
Designing a Hypermedia API with {Grape} & Roar
Daniel Doubrovkine @dblockdotorg
sale JSON
1K+ cache.delete
GET /api/v1/me/follows
{ _type:* }
GET /api/v1/…
5 years later …
https://developers.artsy.net
Adopt a standard …
JSON+HALJSONAPI
Collection+JSONSIREN
JSON-LD
1:1 URI:RESOURCEpath?query=string
API RootDiscoverable API
Document
Collections
typed
https://github.com/dblock/grape-with-roarImplement it!
https://github.com/dblock/grape-with-roar-walkthrough
Map 1:1 with Database Fields vs. Relations
Use Version Headers and Media Types
curl 'http://api.artsy.net/api' -H 'Accept:application/vnd.artsy-v2+json'
Make it Flat
Paginate with Offsets, not Pages
Present Everything, Including Errors