Webhooks, their essential role in business

Created by
Monday, June 6, 2016

Webhooks explained:

Put simple Webhooks are HTTP callbacks, user defined. Wiki:(a callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time). Essentially it is a way for a program or system to notify you or another application when an event occurs. Webhooks deliver the data as they happen via ‘Events’. They are different from API’s in the way that they don't need to check for data changes. In setting up a Webhook URL (webhook endpoint) is registered and notified anytime an event occurs.

 

Webhooks allow for open ended integration with web services. They are not by any means a new technology, nor are they explicitly tricky to work with. Web applications and SaaS technologies today are relying on real time notifications between applications. It is gradually becoming an essential UX feature in creating rich and aesthetic applications. Webhooks play an important role in communication over the internet.

 

Common Examples:

Many are familiar with the messaging service Slack. Slack API now provides support for incoming and outgoing Webhooks. For example users can now do things like send messages from a Slack channel to an external source. Any external source could be utilized as long as it is capable of working with JSON payloads. Users can also request notifications based on a store of changing data.

 

If you are familiar with Dropbox you may notice that when a file is “Dropped” into a folder all the users of that shared folder get a notification. A Webhook is responsible for giving you this real time notification. This works in the exact same manner as a windows outlook notification that an email has been received.

 

Recurring events may be considered the most important role of Webhooks. Let's take an example of a video or music streaming service like Spotify or Netflix. All users that register for their premium services must pay a flat monthly “recurring fee”. Here are a few use cases in which we could use webhooks to fulfill notifications when any of the following events occur.

  • A successful payment has been made for this month's service.
  • An email will be sent to the user as their payment failed.
  • Our accountants systems are notified that this user made or attempted a payment.
  • The user decided to cancel their premium subscription.



Fictitious Example (Ace Apples):

In this example i am going to discuss how Webhooks may be beneficial to all the operations that could happen in any business. In this use case we have a company called Ace Apples. Ace apples sell apples through their Shopify based site. Behind their company walls they have the usual collection of employees (Yellow).

  • Developers
  • Marketing
  • Sales
  • Customer Service
  • Accountants

In (Blue) you can see the SaaS applications that each of these groups choose. They all have their own areas, however they all work closely with Dropbox for files storage and secure transfer, and they all chat via Slack.

 

Let's discuss a few Webhook use cases via this fictitious company.

 

  1. Customer service gets a call from a client who wants to cancel their monthly delivery of apples. Using their in house application they click the cancel button. This triggers an event to the accountants to notify them that a customer has requested to end their billing schedule. It also triggers an event to notify marketing. Marketing decide to send out a survey after they leave to see what they thought of Ace apple's services.
  2. Sales has been going over the Shopify site recently. One of them has noticed a small bug. As this sales rep is not very techie they decide to send a slack message along with a screenshot notifying the developers channel that they have noticed a bug. Instantly all the developers get a slack message. One developer decides to take on this bug and creates a JIRA ticket.
  3. The Manager wants to see this bug so he asks the sales rep to send a copy of the screenshot to his secure Dropbox. A notification lets him know when the sales rep has added the file to his folder.

 

With just 3 simple use cases and a diagram above you can see how this communication between all these 3rd party applications works. I’m sure you can see many other combinations of events that can occur, along with many other SaaS applications you know of.

 

Advantages:

 

If you are working with an SaaS product you should already be on this Webhook trend for real time notifications. If not get the dev team going! As you can see above the relationship between one service and another can be a massive selling point when companies are choosing between third party products and integrations. I for example have found myself fully committed to the Confluence packages (JIRA, BitBucket, Confluence) mainly because they work so well together but also because they work with some many other products seamlessly.

 

Articles for Devs:

 

If you are interested in reading a more technical based article on Webhooks then do refer to Scott Hanselman’s great article: http://www.hanselman.com/blog/IntroducingASPNETWebHooksReceiversWebHooksMadeEasy.aspx

Ravi Kiran also wrote a great article on consuming Webhooks from Github: http://www.dotnetcurry.com/aspnet/1245/aspnet-webhooks-receive-webhooks-from-github

I hope found this article insightful as you start diving into Webhooks. I will be building out an ASP.NET C# example shortly and providing it for forking on Github so please do check soon for a link to that article.

 

References:

https://en.wikipedia.org/wiki/Callback_%28computer_programming%29

https://slack.com/apps/A0F7XDUAZ-incoming-webhooks

https://api.slack.com/outgoing-webhooks

https://stripe.com/docs/webhooks

https://www.dropbox.com/developers/reference/webhooks

Tags:
webhook
5
Rating
1 2 3 4 5

Save

Saved

Report

Reported
Reasons
Cancel
0 comments