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+HAL 
JSONAPI 
Collection+JSON 
SIREN 
JSON-LD
1:1 URI:RESOURCE 
path?query=string
API Root 
Discoverable API
Document
Collections 
typed
Implement it! 
https://github.com/dblock/grape-with-roar 
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
Thanks! 
@dblockdotorg / dblock@dblock.org / artsy.net

Designing a Hypermedia API with Grape & Roar