Hypermedia APIs – Why, what, how?

Hypermedia APIs – Why, what, how?

High-level view of Hypermedia APIs from a pragmatic viewpoint. Presented at Helsinki Ruby Brigade January 2014 meet-up.

C8331af7b049b23f41664ff4b2675f07?s=128

Vesa Vänskä

January 13, 2014
Tweet

Transcript

  1. Hypermedia APIs Why, what, how? Vesa Vänskä, Kisko Labs Helsinki

    Ruby Brigade, Rails Girls
  2. Warning!

  3. What if all changes of the backend wouldn't require an

    update to the frontend?
  4. Current state is like brittle Selenium tests

  5. 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
  6. URLs in the response aka HATEOAS

  7. https://developer.paypal.com/docs/api/#hateoas-links

  8. http://37signals.com/svn/posts/3373-getting-hyper- about-hypermedia-apis

  9. REST?

  10. Increased flexibility

  11. Example: Feature needs to be disabled

  12. Example: Form fields need to be changed

  13. How would you build a Hypermedia API?

  14. State machine

  15. Following a link changes the state

  16. http://whyidentity.blogspot.fi/2013/04/hypermedia- links-in-paypal-restful-apis.html

  17. http://www.jayway.com/2012/10/06/why-hypermedia- apis/

  18. • Response generators • Clients • Documentation tools Tooling

  19. Swagger http://developers.helloreverb.com/swagger/

  20. Adoption

  21. Books Designing Hypermedia APIs by Steve Klabnik

  22. Other resources A Hypermedia API Reading List http://blog.steveklabnik.com/posts/ 2012-02-27-hypermedia-api-reading-list

  23. Future ambitions

  24. Media-type standardization JSON Schema, HAL, Collection+JSON etc.

  25. Unified documentation

  26. Thank you! twitter.com/vesan vesavanska.com