×
Copy
Open
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
Hypermedia APIs Why, what, how? Vesa Vänskä, Kisko Labs Helsinki Ruby Brigade, Rails Girls
Slide 2
Slide 2 text
Warning!
Slide 3
Slide 3 text
What if all changes of the backend wouldn't require an update to the frontend?
Slide 4
Slide 4 text
Current state is like brittle Selenium tests
Slide 5
Slide 5 text
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
Slide 6
Slide 6 text
URLs in the response aka HATEOAS
Slide 7
Slide 7 text
https://developer.paypal.com/docs/api/#hateoas-links
Slide 8
Slide 8 text
http://37signals.com/svn/posts/3373-getting-hyper- about-hypermedia-apis
Slide 9
Slide 9 text
REST?
Slide 10
Slide 10 text
Increased flexibility
Slide 11
Slide 11 text
Example: Feature needs to be disabled
Slide 12
Slide 12 text
Example: Form fields need to be changed
Slide 13
Slide 13 text
How would you build a Hypermedia API?
Slide 14
Slide 14 text
State machine
Slide 15
Slide 15 text
Following a link changes the state
Slide 16
Slide 16 text
http://whyidentity.blogspot.fi/2013/04/hypermedia- links-in-paypal-restful-apis.html
Slide 17
Slide 17 text
http://www.jayway.com/2012/10/06/why-hypermedia- apis/
Slide 18
Slide 18 text
• Response generators • Clients • Documentation tools Tooling
Slide 19
Slide 19 text
Swagger http://developers.helloreverb.com/swagger/
Slide 20
Slide 20 text
Adoption
Slide 21
Slide 21 text
Books Designing Hypermedia APIs by Steve Klabnik
Slide 22
Slide 22 text
Other resources A Hypermedia API Reading List http://blog.steveklabnik.com/posts/ 2012-02-27-hypermedia-api-reading-list
Slide 23
Slide 23 text
Future ambitions
Slide 24
Slide 24 text
Media-type standardization JSON Schema, HAL, Collection+JSON etc.
Slide 25
Slide 25 text
Unified documentation
Slide 26
Slide 26 text
Thank you! twitter.com/vesan vesavanska.com