hypermedia apis – why, what, how?
DESCRIPTION
High-level view of Hypermedia APIs from a pragmatic viewpoint. Presented at Helsinki Ruby Brigade January 2014 meet-up.TRANSCRIPT
Hypermedia APIs Why, what, how?
Vesa Vänskä, Kisko Labs Helsinki Ruby Brigade, Rails Girls
Warning!
What if all changes of the backend wouldn't require an update to
the frontend?
Current state is like brittle Selenium tests
HyperText is a way to link and access information of various kinds as a web of nodes in which the user
can browse at will.
— Tim Berners-Lee, 1992
URLs in the response aka
HATEOAS
https://developer.paypal.com/docs/api/#hateoas-links
http://37signals.com/svn/posts/3373-getting-hyper-about-hypermedia-apis
REST?
Increased flexibility
Example: Feature needs to be
disabled
Example: Form fields need to be
changed
How would you build a
Hypermedia API?
State machine
Following a link changes the state
http://whyidentity.blogspot.fi/2013/04/hypermedia-links-in-paypal-restful-apis.html
http://www.jayway.com/2012/10/06/why-hypermedia-apis/
• Response generators
• Clients
• Documentation tools
Tooling
Swagger http://developers.helloreverb.com/swagger/
Adoption
Books
Designing Hypermedia APIs by Steve Klabnik
Other resources
A Hypermedia API Reading List http://blog.steveklabnik.com/posts/2012-02-27-hypermedia-api-reading-list
Future ambitions
Media-type standardization
JSON Schema, HAL, Collection+JSON etc.
Unified documentation