Thursday, 6 October 2016

What are Webhooks and Webhooks vs WebAPI ?


 If you ever used API’s then you know they follow request - response mechanism . Every Request is followed by a Relevant API Response

Example 1 -  if we need to fetch our emails we will make a Reques to API with required credentials like Emailid, MessageCount and userid and API will give our Emails in Response to Source From where Request Came

Whereas As Webhooks works little different Sometime they are Called as 'Reverse APIs' Webhooks Skips this request part there is no need to give any request to them they are set to give you response data without knocking them

Best example will be Notification System Used by several Applications Like - Twilio, Dropbox for Giving Notifications to your System
Webhooks don’t require a request to be sent to give response they are set and programmed to provide details , messages , Notifications whenever available

Example 2
You can receive a WebHook when someone sends you money to your PayPal account. PayPal fires off a POST request to your predefined URL handler and then your app does something with that notification. You pre-configure everything on the PayPal side first. You also set up an application to handle the incoming POST request. The event notification is "pushed" to you in (near) real-time. No need to hold open a network connection while waiting for events.

For Using webhook, you need to register with the company providing the service by providing URL that will be your website url. That URL is a place in your application that will receive the data from that webhooks such notification messages and do something with it such as saving them to db and notifying to user . In some cases, you can tell the provider the situations when you’d like to receive data. Whenever there’s something new, the webhook will send it to your URL.

I will continue to Adding More details to Post Soon ....

Share this

0 Comment to "What are Webhooks and Webhooks vs WebAPI ?"

Post a Comment