What if your API could call you?
That's what webhooks do, and I just wrote the webhooks guide for Troyal, my fictional royalty-tracking API. This follows the error codes guide, the changelog and the Jira board from last time.
An API mostly consists of you asking it for things. Webhooks are designed to flip that narrative so that Troyal tells you when something happens, like a royalty statement being generated, and so a developer doesn't have to keep checking.
The guide covers:
Setting up an endpoint and getting a signing secret.
The five events Troyal can send.
What an event looks like (the payload).
How to check a request really came from Troyal, with a short code example.
What happens when a delivery fails, and how retries work.
The part that took the most care was the signature check.…