Using ASP.NET WebHooks with IFTTT and Zapier to Monitor Twitter and Google Sheets

With the latest drop of ASP.NET WebHooks we have added a generic JSON WebHook receiver, which can be used to receive WebHooks from services like IFTTT and Zapier. Both IFTTT and Zapier provide a huge number of integrations in areas such as productivity, automotive, blogging, CRM, commerce, project management, IoT, social, mobile, collaboration, and much more. For a full list, check out IFTTT channels and browse Zapier zaps.

A really cool thing about both IFTTT and Zapier is that they enable regular HTTP requests to be output of an integration. That is, you can build integrations that when something happens, a Web request is sent to some specified destination.

Here we’ll show how to leverage this to build two simple integrations – one with IFTTT and one with Zapier – and then use ASP.NET WebHooks to receive the result. For IFTTT we wire it up to Twitter monitoring when a tweet is sent, and for Zapier we wire it up to a Google Sheet monitoring when a row is added. These are of course just examples – the possibilities for integrations are endless!

Configuring Generic WebHook Handler

As usual, let’s first create an empty Web Application with Web API in Visual Studio which we will use for receiving WebHooks from IFTTT and Zapier. Btw, if you just want to look at the code then you can also check out this sample. Otherwise, continue by setting the project up for deployment in Azure by checking Host in the cloud:


Install the Microsoft.AspNet.WebHooks.Receivers.Generic Nuget package. The registration happens exactly like in the blog Introducing Microsoft ASP.NET WebHooks Preview by adding this line to the WebApiConfig.Register method:

public static class WebApiConfig
public static void Register(HttpConfiguration config)
// Web API routes
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }

// Initialize Generic JSON WebHook receiver

In this case we want the same receiver to handle both IFTTT and Zapier WebHooks which means that we need two WebHook URIs looking like this (one for IFTTT and one for Zapier):


We achieve this by defining the MS_WebHookReceiverSecret_GenericJson application setting as follows:

<add key="MS_WebHookReceiverSecret_GenericJson"
value="i=1388a6b0d05eca2237f10e4a4641260b0a08f3a5,z=80ad19e357b01a04fe767067df7cd31b96a844e1" />

As stated in the blog Introducing Microsoft ASP.NET WebHooks Preview, the preferred way to do this is to set it in the Azure Portal. The ‘code’ parameter must be between 32 and 128 characters long and as usual, you should pick values that have high entropy. A good idea is to pick something like a SHA256 hash which you for example can get from FreeFormatter Online Tools For Developers.

Finally, we add a GenericJsonWebHookHandler.cs file containing the following class for processing the incoming WebHooks for both IFTTT and Zapier. Note how we use the ‘Id’ property to differentiate between the two:

public class GenericJsonWebHookHandler : WebHookHandler
public GenericJsonWebHookHandler()
this.Receiver = "genericjson";

public override Task ExecuteAsync(string generator, WebHookHandlerContext context)
// Get JSON from WebHook
JObject data = context.GetDataOrDefault<JObject>();

if (context.Id == "i")
// Received a WebHook from IFTTT!
else if (context.Id == "z")
// Received a WebHook from Zapier!

return Task.FromResult(true);

Integrations using IFTTT’s Maker Channel

Setting up a recipe with IFTTT is fairly straight forward, but obviously you need an account with IFTTT. And just to avoid any confusion, to wire up to Twitter you also need a twitter account. Start by going to My Recipes, then IF, then Create a Recipe, and then this to set up the trigger part:


Look for the Twitter channel:


and select New tweet for you:


Wire it up to your twitter account and create the trigger:


Now select that for the action part:


Search for the Maker channel:


and select the Make a web request action:


Set URL to the first WebHook URI value from above, set the Method to ‘POST’ and Content Type to ‘application/json’.


Also, set the Body to something like this while being careful generating valid JSON – otherwise the WebHook receiver will reject it:

{ "Text": "{{Text}}", "Link": "{{LinkToTweet}}" }
Select Create Action and you should see something like this:

Integrations using Zapier’s WebHook Action

Setting up an integration with Zapier is equally simple, but of course you also need a Zapier account to get going and one for Google Drive to wire up to Google Sheets. Start by going to your dashboard and select Make a new Zap:


Then for trigger search for Google Sheets as the trigger app:


Then pick New Spreadsheet Row as the trigger. Similarly, pick WebHooks by Zapier as the action app and then POST as the action:


For this tutorial I created a Google Sheet with simple data like this:


Now add your Google Sheets account to the trigger part of the Zap in step 2:


The WebHooks by Zapier action doesn’t require any account setup in step 3 so just continue to step 4:


Select the particular sheet you want to monitor and pick the particular worksheet:


Finally, set the URL to the second WebHook URI value from above and set the Payload Type to ’json’:


In step 6 you can test out the zap but for now just go to step 7, enable the zap and get ready to try it out:


Trying it Out

Simply deploy your Web Application Project to Azure and try out the two integrations: To trigger the IFTTT integration, tweet from the account you registered, and for Zapier, add a row to the Google Sheet. For both IFTTT and Zapier there is a delay, at least in the free tier, for some minutes before changes cause a WebHook to fire. However, in both cases you can manually run the integration to cause it to fire.

If you attach the debugger and add a row to the Google Sheet you and then run the zap manually, you should see this show up in the debugger like this:


Similarly, after you tweet you should see the same breakpoint getting hit but this time for the IFTTT integration.

That’s it – you can now build integrations using IFTTT and Zapier and get the result straight into ASP.NET using ASP.NET WebHooks.

Have fun!