We are very excited to announce the availability of ASP.NET WebHooks Release Candidate 1. Thank you for all the positive feedback, suggestions, pull requests, and comments to date – they are essential to the process so keep them coming!
WebHooks provide a simple mechanism for sending event notifications across web applications and external services. For example, you can subscribe to receive a WebHook when someone sends money to your PayPal account, or when a message is posted to Slack, or a picture is posted to Instagram – the opportunities are endless! When subscribing, you provide a callback URI where you want to be notified. When an event occurs in the service you subscribe to, a WebHook is sent to your callback URI with information about what happened so that your Web Application can process it accordingly. WebHooks happen without polling and with no need to hold open a network connection while waiting for event notifications.
ASP.NET WebHooks provides support for receiving WebHooks from other parties as well as sending WebHooks so that you can notify other parties about changes in your service:
- On the receiving side, it provides 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 and Kudu, BitBucket, Dropbox, GitHub, Instagram, MailChimp, PayPal, Pusher, Salesforce, Slack, Stripe, Trello, WordPress as well as IFTTT and Zapier, but it is easy to add more. It also supports queued processing of WebHooks so that they can be processed elsewhere.
- On the sending side it provides support for managing and storing subscriptions as well as for sending event notifications to the right set of subscribers. This allows you to define your own set of events that subscribers can subscribe to and notify them when things happens. ASP.NET WebHooks provides a lot of flexibility for sending and persisting WebHooks, scaling up and out your solution, as well as sending WebHooks from WebJobs and other places in addition to your Web Application. Out of the box, WebHooks subscriptions can be stored in Azure Table Storage or SQL, but they can actually be stored anywhere.
Currently ASP.NET WebHooks targets ASP.NET Web API 2 and ASP.NET MVC 5. It is available as Open Source on GitHub, and you can use it as preview packages from Nuget. For feedback, fixes, and suggestions, you can use GitHub, StackOverflow using the tag asp.net-webhooks, or send me a tweet.
We have a bunch of samples, blogs, and preliminary documentation. Below is a set of pointers that you may find helpful. If you are new to ASP.NET WebHooks, then check out the blog Introducing Microsoft ASP.NET WebHooks Preview.
Sending WebHooks
The following resources provide details about building support for sending WebHooks:
- Sending WebHooks with ASP.NET WebHooks Preview describes the basic model for handling WebHook subscriptions, generating event notifications, and for receiving such WebHooks. Also check out the associated sample of a basic Web Application sending custom WebHooks and a sample receiving custom WebHooks.
- The blog New Year Updates to ASP.NET WebHooks Preview Dec 2015 goes into details for how to send events to all users and how to scale up and out your solution using persistent queues. There is also a sample scaling out WebHooks by sending them to a queue.
- The blog Sending ASP.NET WebHooks from Azure WebJobs describes how to send WebHooks from WebJobs, which enable you to generate WebHooks triggered by a number of sources including queues, blogs, etc. See also the associated sample sending WebHooks from a WebJob.
- The blog Updates to Microsoft ASP.NET WebHooks Preview Nov 2015 describes how to store WebHook registrations in SQL and how to register WebHook modules with a dependency engine.
Receiving WebHooks
The following resources provide details about how to receive WebHooks:
- Sending and Receiving WebHooks triggered by workflows and custom workflow activities from Microsoft Dynamics CRM.
- Subscribing to Instagram listening for media posted within a given geo-location and associated sample.
- Subscribing to new and updated leads and opportunities from Salesforce.
- Subscribing to Slack WebHooks and Using Slack Slash Commands enabling rich commands with structured data, images, and more. Please also see associated sample.
- Integrating with IFTTT and Zapier to Monitor Twitter and Google Sheets and associated sample.
- Receiving WebHooks from Azure Alerts and Kudu (Azure Web App Deployment) and associated sample.
- Sample building a Bitbucket WebHooks receiver.
- Sample building a Stripe WebHooks receiver.
Tooling
Thanks to Brady Gaster, we we have a Preview of a WebHooks Visual Studio Extension!
As always, let us know what you think and have fun!
Henrik