We must understand the concept of webhook as most of the websites provide webhooks to subscribe their events.
When I heard this concept for the first time, I was amazed and really wondering how to actually use it. Then I researched on it and found the concept interesting and would like to share the same with you.
Let us look at a scenario in real life. you have to pick up someone who has gone for a live concert and not sure when the concert would be over. You are calling that person around the estimated time and asking after every 10 mins if the concert is over and he/she should be picked up. Here instead of you calling that person again and again, you both mutually decide that the person will call you once the concert is over and then you will come and pick up. This is like call me up once done :). This is exactly what webhook does.
The Wikipedia definition of webhook is
“A webhook in web development is a method of augmenting or altering the behavior of a web page, or web application, with custom callbacks. These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with the originating website or application. The term “webhook” was coined by Jeff Lindsay in 2007 from the computer programming term hook.“
Most of us are familiar with the word API which stands for Application Programming Interface. Whenever we need data or any functionality, we call the APIs and get required data such as find the good restaurants in this area. We use APIs to send the survey. However when we need real-time response when anyone responds to the survey, our program cannot keep calling the API frequently and check if there is any response. Instead of doing this tiresome job, we register the webhook and it informs us whenever there is any response.
Webhook is HTTP call back and it shares the data whenever it is available.
Similar concept is used in Kaizala or many other websites to provide us the response. We need to register web URL with their service and whenever event happens it would post the data to your url. Now it is up to you what you want to with this data.Most of webhooks I have come across, post the data in the form of JSON format.
You can just create an event handler, host it on Azure and register its url to the webhook.
Please go through the below link for webhook reference.
In my next blog let us see how to use the webhook in Kaizala and get the survey response on real time.
Thank you for reading for my blog. Please comment and share if you like if you find the write up useful.
5 thoughts on “What is Webhook?”
This is really nice blog and explains concept very well. One question as webhook call is http and not secured call is there a provision of secured call in case of secured applications?
It can be http as well as https as well. The way you define your webhook to accept the http or https url, it would behave.
Well explained webhook concept in easy and understandable language. This post is not seen in the sequential order of the Kaizala post. Appreciate if you put there so it would be easy for others as well. Hope you put up some more related blogs as well.
Thank you Akash for your comment. Well definitely will try to add more about this topic as and when I use it more.