Many advanced API companies such as Github, Stripe or Slack offer Webhooks. But do you really need them when you already have RESTful APIs?
Got RESTful APIs?
Great. API consumers love them. But today, such RESTful APIs are not enough for the evolving expectations of API consumers. Their apps need to be responsive, event-based and react to changes in near real-time.
This results in a new set of requirements for the APIs, which power the apps. APIs now need to provide concepts such as events, notifications, triggers, and subscriptions. These concepts are not natively supported by the REST architectural style.
The good thing: we can engineer RESTful APIs that support events with a webhook infrastructure. The bad thing: it requires some heavy lifting. The infrastructure needs to be developer-friendly, easy to use, reliable, secure and highly available.
Best Practices for Webhooks
Webhooks are a collection of best practices for supporting events in a RESTful architecture.
But what exactly are the best practices? With the best practices and design templates provided in this book, we want to help you extend your API portfolio with a modern webhook infrastructure. So you can offer both APIs and events that developers love to use. This book helps you find the answer for your API and application.
When using and designing webhooks, there are a couple of stumbling blocks that you typically come across. Don’t let them trip you up! How do they work and can they be used? How shall they be designed to be most useful for API consumers?
There are the roles of provider and consumer, resulting in different perspectives on webhooks and various interactions around webhooks which are often confused. In addition, designers need to be aware of the choices they have when designing webhooks and what these choices entail.
In this book, we provide a clean terminology for webhooks, as a basis for a clean design following the REST constraints. We study design choices that need to be made when designing webhooks for your application and API portfolio, and we consider the resulting non-functional properties, such as security, performance, and availability. As always, there are tradeoff decisions involved, allowing you to design webhooks that best fit your application, use-case, clients, and APIs. In addition, we provide some practical guidance and tools for developing and testing webhook integrations.
We study the webhooks designs of the well-known APIs of GitHub, Stripe, Slack, Intercom, and Bitbucket, to see these concepts in action. We also survey alternative approaches, technologies, and standards for supporting events.
The API-University Series is a modular series of books on API-related topics. Each book focuses on a particular API topic, so you can select the topics within APIs, which are relevant to you.
Keywords: Webhooks, API, REST, Event, Web Hook, Callback, Notification
⭐⭐⭐⭐⭐ Great book!
Get the Book
Title: Webhooks – Events for RESTful APIs