Hacker News new | ask | show | jobs
by brian_cooksey 4663 days ago
Server A has events Server B wants to know about. With REST Hooks, Server A provides an API that Server B use to tell Server A "Please POST notifications about those events to this URL". Then Server B keeps a web server listening for requests to that url. There is no persistent connection.

As for timeouts, check out http://resthooks.org/docs/retries/ for ideas on how those problems can be solved.

1 comments

So it's an API to configure webhooks on Server A?
I think it's more of an API to allow Server B to register its interest in receiving notifications from Server A.

Of course, Server A must "speak Rest Hook" in order to enable that, so in a manner of speaking I guess it is a way to configure Webhooks on Server A.

But, it basically exposes a common interface for Server A and Server B to establish Webhooks. Server A can tell Server B which notification subscriptions are available (i.e. for which events), and Server B can then choose to subscribe, providing the callback URL for the Webhook.