Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Webhooks & Asp.Net

3,078 views

Published on

Use Asp.Net Webhooks to connect an api to a web-automation service

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Webhooks & Asp.Net

  1. 1. USE ASP.NET WEBHOOKS TO CONNECT AN API TO A WEB- AUTOMATION SERVICE Jan Vanuytrecht
  2. 2. WEBHOOKS? • Pattern to connect web services Trigger Actio n Retry Secr et
  3. 3. AUTOMATION SERVICES? • Connect two services • IFTTT and Zapier • Trigger (Github: comment or mention, pull request) • Action (Slack : new message in channel)
  4. 4. ASP.NET WEBHOOKS: RECEIVER Instant Queued
  5. 5. ASP.NET WEBHOOKS: SENDER Subscriptions Notifications to set of subscribers Retry policy
  6. 6. 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
  7. 7. RECEIVER: SLACK
  8. 8. RECEIVER: GENERICJSON • Nuget package: Microsoft.AspNet.WebHooks.Receivers.Generic • WebApiConfig > config. InitializeReceiveGenericJsonWebHooks(); • Web.config: add appSetting MS_WebHookReceiverSecret_GenericJson with token
  9. 9. RECEIVER: GENERICJSON (IFTTT)
  10. 10. SEND TO ZAPIER • Create ZAP • Choose Webhooks • Copy URL • Send http request to Zapier’s custom provided URL
  11. 11. SEND TO ZAPIER
  12. 12. SOURCES • http://docs.asp.net/projects/aspnetwebhooks/en/latest/receiving/index.html • @vanuyja • @NaratoBE

×