Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ben Ramsey:
Lack of Hypermedia
Nov 27, 2015 @ 15:37:38

In a post to his site today Ben Ramsey shares his response to a question about hypermedia in APIs and how they could make the API more brittle if used incorrectly.

One of the most common problems I see in API development is lack of hypermedia, or none at all. By hypermedia, I mean links that describe relationships among data in the API. When hypermedia isn’t used, the API becomes brittle, and those building clients that talk to the API are forced to code to URLs. The URLs become an important interface to the API, and if they change, they break everything. This leads to URL-based versioning schemes, and the only upgrade path for clients is to modify their code to accommodate the new versions.

He suggests that when APIs use hypermedia they tend to no longer rely on the URLs of the resources (as they're linked from the meta in other requests). He also shares the slides for a presentation he gave at this year's True North PHP Conference with more information on the topic.

tagged: hypermedia lack url resource link

Link: https://benramsey.com/blog/2015/11/lack-of-hypermedia/

NoCapes Podcast:
Interview with Luke Stokes
May 25, 2015 @ 16:52:22

The NoCapes podcast has posted their latest episode, hosted by PHP community member Kayla Daniels. In this new episode she talks with Luke Stokes of FoxyCart.

In this episode of NoCapes, Luke Stokes discusses the journey towards hypermedia APIs, what is it and why hypermedia APIs are important.

You can watch this latest episode either on the NoCapes site or over on YouTube directly. If you enjoy the show you should subscribe to their mailing list and get more information as it's sent.

tagged: nocapes podcast interview lukestokes api hypermedia foxycart

Link: https://www.youtube.com/watch?t=39&v=j43ZYS_wc8g

Satish Gopal's Blog:
Building RESTful services - part 2
Mar 28, 2012 @ 16:43:49

In part two of his series (part one is here) on building RESTful interfaces, Satish Gopal talks about things like hypermedia and HATEOAS.

This is part 2 of "Building RESTful services". In Part 1 we talked about Level 1 and Level 2 of the Richardson Maturity Model. [...] Now imagine if you had to [find the URI] for every single website, each having a different kind of document in a different custom format. The internet would certainly not be what it is today. Yet a majority of the APIs built today make us do this. This is where the hypermedia concept comes in.

He describes the concepts behind hypermedia, giving examples of how this sort of data can be included in your API's responses. To illustrate, he includes some "link" information that then points to other data for things like "moreInfo" and "reviews" in his Book example. He also describes HATEOAS (Hypermedia As The Engine Of Application State) showing how to use this "link" information to make it simpler for the end user/application to navigate around between data sources in the application.

tagged: rest webservice series hypermedia hateoas

Link:


Trending Topics: