hypermedia apis – why, what, how?

26
Hypermedia APIs Why, what, how? Vesa Vänskä, Kisko Labs Helsinki Ruby Brigade, Rails Girls

Upload: vesa-vaenskae

Post on 11-May-2015

959 views

Category:

Technology


4 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Hypermedia APIs – Why, what, how?

Hypermedia APIs Why, what, how?

Vesa Vänskä, Kisko Labs Helsinki Ruby Brigade, Rails Girls

Page 2: Hypermedia APIs – Why, what, how?

Warning!

Page 3: Hypermedia APIs – Why, what, how?

What if all changes of the backend wouldn't require an update to

the frontend?

Page 4: Hypermedia APIs – Why, what, how?

Current state is like brittle Selenium tests

Page 5: Hypermedia APIs – Why, what, how?

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

Page 6: Hypermedia APIs – Why, what, how?

URLs in the response aka

HATEOAS

Page 7: Hypermedia APIs – Why, what, how?

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

Page 8: Hypermedia APIs – Why, what, how?

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

Page 9: Hypermedia APIs – Why, what, how?

REST?

Page 10: Hypermedia APIs – Why, what, how?

Increased flexibility

Page 11: Hypermedia APIs – Why, what, how?

Example: Feature needs to be

disabled

Page 12: Hypermedia APIs – Why, what, how?

Example: Form fields need to be

changed

Page 13: Hypermedia APIs – Why, what, how?

How would you build a

Hypermedia API?

Page 14: Hypermedia APIs – Why, what, how?

State machine

Page 15: Hypermedia APIs – Why, what, how?

Following a link changes the state

Page 16: Hypermedia APIs – Why, what, how?

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

Page 17: Hypermedia APIs – Why, what, how?

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

Page 18: Hypermedia APIs – Why, what, how?

• Response generators

• Clients

• Documentation tools

Tooling

Page 19: Hypermedia APIs – Why, what, how?

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

Page 20: Hypermedia APIs – Why, what, how?

Adoption

Page 21: Hypermedia APIs – Why, what, how?

Books

Designing Hypermedia APIs by Steve Klabnik

Page 22: Hypermedia APIs – Why, what, how?

Other resources

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

Page 23: Hypermedia APIs – Why, what, how?

Future ambitions

Page 24: Hypermedia APIs – Why, what, how?

Media-type standardization

JSON Schema, HAL, Collection+JSON etc.

Page 25: Hypermedia APIs – Why, what, how?

Unified documentation

Page 26: Hypermedia APIs – Why, what, how?

Thank you!twitter.com/vesan

vesavanska.com