Chapter 32

Third Module Conclusion

While this module was much shorter than the other two, I hope it gave you a nice introduction to real RESTful APIs and the use of hypermedia in representations.

Most APIs out there look more like the one we built in the second module, but I think things are starting to slowly change. That’s why it’s important to start looking at hypermedia and the emerging web standards that relate to it.

I’m planning to expand this module in future editions of the book to include the latest developments.

32.1. What Did You Learn?

In the short third module, we learned more about REST and how to build a real RESTful web API. Let’s go through each chapter.

Chapter 29: REST

In this chapter, we talked about REST and its constraints, what they mean, and why they exist. We’ve also learned that most web APIs are not RESTful, but that it’s totally possible to build a great API without being completely RESTful.

  • What is REST?
  • What are the REST constraints?
  • What is a stateless authentication system?

Chapter 30: Alexandria and The REST Constraints

Alexandria is not RESTful. In this chapter, we looked at why this was the case and tried to see how we could fix it. We took the first step toward a RESTful Alexandria by using a custom media type and adding hypermedia. However, we didn’t fix the stateless issue since we want to stay in control of the users’ states.

  • What are the advantages and drawbacks of stateless authentication?
  • Why did we choose to stay stateful in Alexandria?

Chapter 31: Hypermedia Formats

In this last chapter, we studied the current emerging hypermedia formats.

We’ve learned how JSON-lD, Hydra, JSON-API, and the others work and how we can use them.

32.2. Wrap Up

While this module was short, I hope it made you want to look into hypermedia a bit more. The idea of building hypermedia APIs is still quite recent and much of the community hasn’t picked it up yet, nor do a lot of people really believe in its usefulness.

With this introduction to hypermedia, you should have the knowledge to dive into it more… it if you’re interested.