Subscribe to our Blog

×
Kin Lane
By Kin Lane Services, World of APIs June 2, 2016

I was learning more about using the Link header for pagination the other day, as part of my work on the Human Services Data Specification (HSDS), and this approach to putting hypermedia links in the header got me thinking about other possibilities.

Part of the reason I was considering using the Link header for pagination on this particular project was that I was looking to alter the existing schema as little as possible — I liked that I could augment the response with links, using the header.

connection-api

Another side thought I had along the way revolved around the possibilities for using it to augment third-party APIs, and APIs from an external vantage point. It wouldn’t be too hard to route API requests through a proxy, which could add a header with a personalized set of links tailored for each API request. If the request was looking up flights, the links could be to value-added services which might influence the decision, such as links to hotels, events, and other activities. If you were looking up the definition of a word, the links could be to synonyms — endless possibilities.

You wouldn’t have to just use it for pagination and other common link relations. You could make it more about discovery, search, or even serendipity injected from outside sources. I think the fact that you can augment an existing response using a header opens up a lot of possibilities for adding hypermedia behaviors to existing APIs. It might also be an interesting way to introduce existing API owners to hypermedia concepts by showing them the value that can be added when you provided valuable links.

Maybe you’ll like these posts