Webhooks correct terminology
Context: I am working on an app, I need to be able to explain this to the rest of the team and not get myself/others confused.
Scenario:
I registered a "thing" on a service that sends POST requests to an API endpoint on my server when certain things happen (a webhook?). When my server receives this request, I write the data from it to my database and respond with 200.
Question:
What's THE webhook in this scenario? Is the webhook the endpoint on my server that's receiving these events, or is the webhook the service itself that's sending these events? Or is it somehow the whole thing together?
4 Replies
From what I understand, the “webhook” is the event in its entirety:
If you ask three different developers what a webhook is, you'll get three different answers. Stripe's API is always a good reference for things like this. They call each webhook subscription a "webhook endpoint" https://stripe.com/docs/api/webhook_endpoints
Honestly because it's such an overloaded term, I would not use the word "webhook" to describe any particular part, but rather tack another term onto the end of it.
i.e.
- you can call an individual request a "webhook request"
- your long-lived subscription to an event is a "webhook subscription" (or in Stripe's terms, a "webhook endpoint")
- the service that sends you webhook events is, idk, a "webhook request producer"?
- your service that receives events is maybe a "webhook request consumer"?
- stripe considers an "event" to be the type of thing that happens (like "charge.failed")
Thanks for the insights, I think the approach with adding an additional term to further specify what I'm talking about is the best way