This is the second blog post on building hypermedia APIs with the focus on API design. In part 1 Lucas describes the concept of links in JSON.
Imagine we have an API where people can like books and other people can then see, who likes a certain book. We want this API to be highly connected: We don’t want to look up URLs in a documentation, we want to follow links as we know it from the world wide web. All we want to do as the author of the API is give our users a single URL from which they can then follow links to all other resources. This is similar to the way we would do this with a website. Leonard Richardson and Mike Amundsen refer to this as the billboard URL for this reason: If you put this URL on some billboard, people know everything to get started with your API. More info
When we create websites we don’t just create single pages that have no connection to other Web pages. From the beginning, hyperlinks were part of the core concept of the World Wide Web and for that reason HTML. Links are so essential to the Web that they are even used to rank the popularity of the Web pages on search engines. And who hasn’t gone on a journey through Wikipedia clicking link after link? Even though we all know and appreciate the importance of links on Websites, we rarely use links in our Web APIs. More info