I've just come across this relatively "new" web concept. When I say new concept, I actually mean a new way of using existing web technology.
What is Webhooks?
Webhooks "...is a method of augmenting or altering the behavior of a web page, or web application, with custom callbacks...". This basically means actions on a web app. can be configured to invoke an event or behaviour on another.
The idea behind Webhooks is sort of similar to the
PublishSubscribe Java Mail pattern I played with some years ago, but for the web.
How does it work?
Essentially, a web app registers a custom http callback (a URL to the callback handler) on a another web app. for a certain event. The callback is triggered before, during or after the event of interest is fired on the host web app.
This is especially useful when consuming API services.
For example, if I make an API request to send out 10,000 emails, I obviously can't wait around for all emails to be sent before moving on. With the Webhooks concept, I can register a custom http callback, which means I get notified when the job is done.
Websites using the Webhooks?
Google, Facebook, Github, Webscript.io and many more.