sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Can we create a webhook for specific event type in Share Point?

Open SABARISHV06 opened this issue 7 years ago • 6 comments

Can we create a webhook for specific event type in Share Point? Notifications are sent to your application for the following asynchronous list item events in SharePoint: ItemAdded ItemUpdated ItemDeleted ItemCheckedOut ItemCheckedIn ItemUncheckedOut ItemAttachmentAdded ItemAttachmentDeleted ItemFileMoved ItemVersionDeleted ItemFileConverted

But, is it something I can do trigger only for ItemAdded, ItemUpdated and ItemDeleted?

SABARISHV06 avatar Aug 27 '19 14:08 SABARISHV06

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Aug 27 '19 14:08 msft-github-bot

Hi, can you clarify a bit more on what you mean? Are you looking to support other events not listed above in your post? Such as synchronous events ending in '-ing' like 'itemAdding' ?

bcameron1231 avatar Aug 27 '19 15:08 bcameron1231

@bcameron1231 i want webhook to trigger only if the document gets added/update/deleted, i don't want to webhook to get trigger for itemcheckedout/checked-in. Do we have option to enable the list of event types allowed while creating the webhook? orelse isit something to find what kind of event type on the subscription end?

SABARISHV06 avatar Aug 27 '19 16:08 SABARISHV06

Unfortunately, I do not believe you can using the SharePoint WebHooks.

You'd need to use the GetChanges endpoint to figure out what the changes were.

Another option, would be to use Microsoft Graph API to get changes notifications. In the response from a webhook, it returns what the change type is (deleted,updated,etc...)

https://docs.microsoft.com/en-us/graph/api/resources/webhooks?view=graph-rest-1.0

bcameron1231 avatar Aug 27 '19 18:08 bcameron1231

Closing issue as "answered". If you encounter similar issue(s), please open up a NEW issue. Thank you.

msft-github-bot avatar Aug 31 '19 11:08 msft-github-bot

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 23 '20 18:01 msft-github-bot