The basic patterns for realizing events with APIs are the interrupt pattern and the polling pattern.

In approaches with the interrupt pattern (e.g. HTTP Streaming, Server-Sent Events, WebSockets, WebSub, Webhooks or GraphQL), the client is notified by an external source when something interesting happens. The responsibility for event execution is with the external source.

In approaches with the polling pattern (e.g. Short Polling or Long Polling), the client needs to figure out when something interesting happens, so the complete responsibility for event execution is with the client.

How do we realize events in an API context? In the new Webhooks Book we study several approaches for realizing events, such as Polling, Long Polling, HTTP Streaming, Server-Sent Events, WebSockets, WebSub, Webhooks and GraphQL Subscriptions.

Technologies for Realizing Events with APIs

Matthias Biehl

As API strategist, Matthias helps clients discover their opportunities for innovation with APIs & ecosystems and turn them into actionable digital strategies. Based on his experience in leading large-scale API initiatives in both business and technology roles, he shares best practices and provides both strategic and practical guidance. He has stayed a techie at heart and at some point, got a Ph.D. Matthias publishes a blog at api-university.com, is the author of several books on APIs, and regularly speaks at technology conferences.