0

I have been looking at the documentation and reference implementation for SharePoint webhooks.

Overview of SharePoint webhooks

SharePoint list webhooks

SharePoint webhooks sample reference implementation

I have done the sample reference implementation within my own solution and I have that running with a Azure Storage Queue and a WebJob that gets triggered by the queue and calls our API to process the changes from the Webhook.

In my ProcessNotification method I haven't really changed anything, since I want to retrieve Item changes and that's what it does.

// grab the changes to the provided list using the GetChanges method 
// on the list. Only request Item changes as that's what's supported via
// the list web hooks
ChangeQuery changeQuery = new ChangeQuery(false, true);
changeQuery.Item = true;
changeQuery.FetchLimit = 1000; // Max value is 2000, default = 1000

Foreach change it will call the DoWork method.

// Process the changes
if (changes.Count > 0)
{
   foreach (Change change in changes)
   {
       lastChangeToken = change.ChangeToken;

       if (change is ChangeItem)
       {
           DoWork(cc, changeList, change);
       }
   }

   // We potentially can have a lot of changes so be prepared to repeat the 
   // change query in batches of 'FetchLimit' untill we've received all changes
   if (changes.Count < changeQuery.FetchLimit)
   {
       allChangesRead = true;
   }
}

In the DoWork method I am able to get the ChangeType enum from the change object, but all I can find on that are the following types:

In the SharePoint list webhooks documentation it's stated that the following list event types will trigger a notification, but I would like to know which one triggered the notification.

  • ItemAdded
  • ItemUpdated
  • ItemDeleted
  • ItemCheckedOut
  • ItemCheckedIn
  • ItemUncheckedOut
  • ItemAttachmentAdded
  • ItemAttachmentDeleted
  • ItemFileMoved
  • ItemVersionDeleted
  • ItemFileConverted

Does anyone know how this can be achieved? I am mostly interested in knowing when the ItemCheckedIn event is triggered, so I can notify people when there is a new version available of a page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.