Supporting Events with RESTful APIs

Got a RESTful API? 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 is that we can engineer RESTful APIs that support events with a webhook infrastructure. But it requires some heavy lifting. The webhook infrastructure needs to be developer-friendly, easy to use, reliable, secure and highly available.

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 actually love to use.

Webhooks are a collection of best practices for supporting events in a RESTful architecture.

But what exactly are the best practices? How do webhooks work and can webhooks be used? How shall webhooks be designed to be most useful for API consumers? This book helps you find the answer for your API and application.

When using and designing webhooks, there are a couple of stumbeling blocks that you typically come across. Don’t let them trip you up! There are the roles of provider and consumer, resulting in different perspectives on webhooks and various interactions around webhooks which are often confused. Unfortunately, inconsistent documentation of webhooks and an unclear or contradictory terminology result in a lot of unnecessary confusion around webhooks. In addition, designers need to be aware of the choices they have when designing webhooks and what theses choices entail.

In this book, we provide a clean terminology for webhooks, as a basis for a clean design for webhooks 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 of the webhook design. 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 webhook designs of some well known APIs to see these concepts in action and to get some inspiration for the design of our own webhooks. 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 for you.

Keywords: Webhooks, API, REST, Event, Web Hook, Callback, Notification

Available December 2017.

Get a Discount Code Now:


Preview Table of Content

Get the Book

Download PDF $39.99
Available December 2017.
Get a Discount Code Now:



Title: Webhooks – Events for REST APIs
Author: Matthias Biehl
Release Date: 2017-12-30
Length: 120 pages
Language: English
ISBN-10: 1979717060
ISBN-13: 978-1979717069
COMPUTERS > Web > Web Programming
COMPUTERS > Web > Web Services & APIs