INTRODUCTION TO WEBHOOKS IN SHAREPOINT ONLINE - Part I
Welcome SharePoint fanatics!!! and casual SharePoint tinkerers, to a new technology talk series hosted in Netwoven. The topic we cover today should hopefully be informative to you and at the same time pique your interest to find more relevant content online and pool into our ever-growing SharePoint Online community.
If you like this read, please leave a reply about who you are, what role do you play in your organization, how you use SharePoint every day and what you like and dislike about SharePoint. And if you dislike this, then please let us know why and how we can improve it.
Today, we look at a practice, that although has been around for a while, has only surfaced into our modern SharePoint development strategies in the last year. Slowly but surely gaining significant popularity on the SharePoint development platforms, today we look at Webhooks in SharePoint Online.
This is going to be the first part of a series of technology talks that we plan to bring to you that covers everything we know about webhooks and everything that we will learn about it along the way!!!
Our agenda for this talk will be
- An introduction to webhooks, and Mention of some popular users of webhooks in the industry today
So, reader, now that you are all excited, continue reading and let’s begin…
To catch everybody up, webhook is a pattern/practice that has been around for a few years now. And it allows for us to develop applications that are event-driven. Rather than using the traditional polling mechanism, webhooks allow you to code a push concept where the application listens for events to occur and then does something.
Most modern platforms support this method, but SharePoint has only recently began implementing it. So, you will find that this feature is still in preview in SharePoint Online and there is no official plan yet to bring it to On-prem. Moreover, the SharePoint Online preview only supports this feature with lists and libraries. So, if you were building an application that listens for modifications in SharePoint permissions then it would not be supported in this preview.
Now, event notification is not a new concept and SharePoint has had many traditional alternatives to Webhooks over the years, like,
- Remote Event Receivers
- Microsoft Flow (Introduced this year)
- RSS Feeds
- Email Alerts
- CSOM Change Logs
But most these methods are complex to implement, like remote event receivers required wcf projects to be created and registration is not simple, workflows (native SharePoint or third party) do not respond to certain event hooks like trigger on delete. More developer focused CSOM change logs use polling mechanisms to respond to events.
With traditional APIs, your client would have to ask SharePoint whether anything changed in a recurring fashion to avoid call expiration and wait for SharePoint to reply back. But this approach is not scalable and with a lot of notification calls you would potentially create denial of service attacks.
With webhooks, SharePoint notifies your client of a change and your client is then responsible for responding back querying for change details.
In the industry, today, modern applications like Facebook, Dropbox, Uber, Slack and even other Microsoft products like OneDrive, and OfficeGraph use webhooks.
We will conclude this talk here and we hope you enjoyed this read and learned something new today. Come back for the Part 2 – Using Webhooks in SharePoint Online where we will show you how we use webhooks in SharePoint Online.