USE ASP.NET WEBHOOKS TO CONNECT AN API TO A WEB- AUTOMATION SERVICE Jan Vanuytrecht
WEBHOOKS? • Pattern to connect web services Trigger Actio n Retry Secr et
AUTOMATION SERVICES? • Connect two services • IFTTT and Zapier • Trigger (Github: comment or mention, pull request) • Action (Slack : new message in channel)
ASP.NET WEBHOOKS: RECEIVER Instant Queued
ASP.NET WEBHOOKS: SENDER Subscriptions Notifications to set of subscribers Retry policy
RECEIVER: SLACK • Web API Project • Nuget package : Microsoft.AspNet.WebHooks.Receivers.Slack" • WebApiConfig > config.InitializeReceiveSlackWebHooks(); • Attribute routing = on! • Slack > Custom integrations • Enter url https://<host>/api/webhooks/incoming/slack , copy token • Web.config: add appSetting MS_WebHookReceiverSecret_Slack with token • Code: WebhookHandler
RECEIVER: SLACK
RECEIVER: GENERICJSON • Nuget package: Microsoft.AspNet.WebHooks.Receivers.Generic • WebApiConfig > config. InitializeReceiveGenericJsonWebHooks(); • Web.config: add appSetting MS_WebHookReceiverSecret_GenericJson with token
RECEIVER: GENERICJSON (IFTTT)
SEND TO ZAPIER • Create ZAP • Choose Webhooks • Copy URL • Send http request to Zapier’s custom provided URL
SEND TO ZAPIER
SOURCES • http://docs.asp.net/projects/aspnetwebhooks/en/latest/receiving/index.html • @vanuyja • @NaratoBE

Webhooks & Asp.Net

Editor's Notes

  • #2 Prep: open fiddler : https://naratowebhooks.azurewebsites.net/api/zapier/LiveDemo! Open integrations slack Open trello Open iftt recipes https://www.eventbrite.com/e/aspnet-webhooks-zapier-live-demo-tickets-21686814847
  • #3 Trigger: Github: comment or mention, pull request Action: Slack : new message in channel
  • #7 managing and storing subscriptions sending event notifications to the right set of subscribers Retry policy: Fail, 1min, 4 mins
  • #10 https://vanuyja.slack.com/apps/manage/custom-integrations
  • #11 https://vanuyja.slack.com/apps/manage/custom-integrations
  • #13 https://naratowebhooks.azurewebsites.net/api/zapier/LiveDemo!