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 in Microsoft SharePoint Online

885 views

Published on

What are Webhooks ?
Who uses Webhooks ?
How webhooks are implemented in SharePoint ?
Demos
Advantages/Disadvantages

Published in: Technology
  • Be the first to comment

Webhooks in Microsoft SharePoint Online

  1. 1. Webhooks in SharePoint Online MATT MAHER
  2. 2. About Netwoven  Microsoft gold partner  Enterprise Content collaboration  Customer relationship management  Cloud productivity and development  Since 2001
  3. 3. Agenda  What are Webhooks  Who uses Webhooks  How webhooks are implemented in SharePoint  Demos  Advantages/Disadvantages
  4. 4. What are webhooks?  A pattern that allows for event driven notification  Uses a push not pull concept  Supported in most modern platforms  SharePoint Implementation  Still in preview for SharePoint Online  Preview only supports Lists and Libraries  No official plans for an on-prem feature pack
  5. 5. What are the alternatives within SharePoint?  Remote Event Receivers  Workflows  Flow  RSS feeds  Email Alerts  CSOM Change log
  6. 6. Webhooks vs Traditional API Client SharePoint Did anything change? Nope Did anything change? Nope Did anything change? Nope Did anything change? Nope Did anything change? Nope Did anything change? Yes, Item 5 Please give me details on Item 5 Details for Item 5 Client SharePoint Your item changed Please give me details on the change Details for Item 5 Webhooks Traditional API
  7. 7. Who uses webhooks?
  8. 8. Subscribe HTTP/ 200 OK {GUID} SharePoint Online POST /_api/web/lists('list-id')/subscriptions Your application POST https://{your host}/your/webhook/service ?validationtoken={GUID} WebHook notification endpoint HTTP/ 201 Created Your application { "resource":"https://netwoveninc.sharepoint.com/_api/web/Lists/getbytitle('Documents') ", “notificationUrl":"http://spsaturday.westus.cloudapp.azure.com", "expirationDateTime":"2016-12-02T00:00:00+00:00" } { "id": "a8e6d5e6-9f7f-497a-b97f-8ffe8f559dc7", "expirationDateTime": "2016-12-27T16:17:57Z", "notificationUrl": " http://spsaturday.westus.cloudapp.azure.com ", "resource": “{list or library id}“ } https://doc.co/Jwbh8r
  9. 9. Webhook Subscribe - Demo
  10. 10. Event notification in action HTTP/ 200 OK SharePoint Online WebHook notification endpoint POST https://{your host}/your/webhook/service { "value":[ { "subscriptionId":"91779246-afe9-4525-b122-6c199ae89211", "clientState":"00000000-0000-0000-0000-000000000000", "expirationDateTime":"2016-04-30T17:27:00.0000000Z", "resource":"b9f6f714-9df8-470b-b22e-653855e1c181", "tenantId":"00000000-0000-0000-0000-000000000000", "siteUrl":"/", "webId":"dbc5a806-e4d4-46e5-951c-6344d70b62fa" } ] } https://doc.co/Jwbh8r
  11. 11. Webhook Notification - Demo
  12. 12. Webhooks Advantages  Simple subscription and notification  Retry ability  Support delete events  Industry standard approach to notifications  In line with modern development stack of SPFx
  13. 13. Webhooks Disadvantages  6 month max expiration  Bare minimum information from SPO  Only Lists and Libraries are supported in SPO preview  Acknowledgement must be received quickly  May take upwards of 5 minutes to receive the notification  No synchronous events from SPO  Subscriptions and notifications go over the same URL
  14. 14. Webhooks Best Practice  Always implement an asynchronous process  Your App should update its subscriptions on a timed interval  Keep limited number of event subscriptions to minimize http requests to server  Log processed events to avoid duplicate event processing  Webhook notification acknowledgement has to be within 5 sec  BPM engines should still be used for more complex processes  Webhooks to replace your Nintex or SharePoint workflows
  15. 15. Webhook client notification - Demo
  16. 16. Resources  Video: https://dev.office.com/blogs/introducing-sharepoint- webhooks  MSDN Details: https://dev.office.com/sharepoint/docs/apis/webhooks/overview- sharepoint-webhooks  Webhook events: https://dev.office.com/sharepoint/docs/apis/webhooks/lists/overvie w-sharepoint-list-webhooks  Github sample: https://github.com/SharePoint/sp-dev- samples/tree/master/Samples/WebHooks.Nodejs
  17. 17. Questions?
  18. 18. THANK YOU

×