March 29 2017
ASP.NET WebHooks service has been around since 2015 and it is quite a popular offering from the ASP.NET ecosystem.
What is WebHooks?
It is a lightweight HTTP pattern providing a simple publishing/subscribing model for wiring together Web APIs and SaaS services. Whenever an event occurs in a service, a notification is triggered in the form of an HTTP POST request to the registered subscribers. The POST request contains information about the event making it possible for the receiver to act accordingly.
For instance, a WebHook can inform that a file has changed in Dropbox, or that a code change has been committed in GitHub, or maybe payment order has been initiated in PayPal, or a card has been added to Trello. There are endless possibilities to the application and use of WebHooks. Microsoft ASP.NET WebHooks makes it easier to both send and receive WebHooks as part of your ASP.NET application. There are many useful tools for ASP.NET application development and WebHooks is increasingly becoming a popular option because of its interesting and diverse use cases.
Because of their inherent simplicity, WebHooks are already used by some popular services and Web APIs such as Azure Alerts, DropBox, GitHub, Kudu, Instagram, PayPal, WordPress to name just a few.
Microsoft recently announced ASP.NET WebHooks V1 RTM making it easy to both send and receive WebHooks with ASP.NET:
It offers a common model for receiving and processing WebHooks from any number of WebHook providers. It comes out of the box with support for Azure Alerts, BitBucket, Dropbox, Dynamics CRM, GitHub, Kudu, Instagram, MailChimp, MyGet, PayPal, Pusher, and so on. But it is also possible and easy to add support for more.
It extends support for generating WebHooks as a result of changes in your service. It helps to manage and store subscriptions as well as to push event notifications to the right set of subscribers. This allows defining your specific set of events that the users can subscribe to. There is great flexibility in sending and persisting WebHooks, scaling your solutions up and out, and publishing WebHooks from WebJobs and places other than your web app.
The two elements of WebHooks (that is sending and receiving) can be used together or apart depending on the use case. If you only need to receive WebHooks from other apps, then you can choose just to receive, or if you only want to expose WebHooks for others to utilize, you can opt for that. Apart from hosting your own WebHook server, ASP.NET WebHooks are also part of Azure Functions where you can process them without hosting or managing your own server. Additionally, you can go one step further and host an Azure Bot Service using Microsoft Bot Framework to develop cool bots talking to your customers.
The WebHook code targets ASP.NET Web API 2 and ASP.NET MVC 5 which is available as Open Source on GitHub, and as NuGet packages.
The big benefit of using WebHooks in a nutshell - instant, real-time notifications. WebHooks enables the web to start being aware of events, to respond to things without user interaction. It also enables the web to push information to its users, without waiting for users to ask for information. Simply put, it means higher efficiency and automation. Does your organization use WebHooks or do you see a possible use case where it would solve a specific challenge? Do let us know in the comments below.