question

WeiZhang-3153 avatar image
0 Votes"
WeiZhang-3153 asked MichaelHan-MSFT commented

Requirement to set up change notification on a specific folder in Sharepoint

I have a requirement to set up a change notification(webhook) on a specific folder in Sharepoint. As I've learned so far, SharePoint API does not support this function. And I want to know if Graph API supports it.

In the Graph API change notification document, I saw it support change notification on drive item.
https://docs.microsoft.com/en-us/graph/api/resources/webhooks?view=graph-rest-1.0
And Items in SharePoint document libraries can be represented as listItem or driveItem resources.
https://docs.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0

So I want to confirm if it's possible for me to set up a change notification for a specific SharePoint document library folder using driveitem?

sharepoint-dev
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @WeiZhang-3153 ,

If my answer is helpful to you, please accept it by clicking "Accept Answer" button. It would be helpful to others who have similar issues in the future.

1 Vote 1 ·

1 Answer

MichaelHan-MSFT avatar image
1 Vote"
MichaelHan-MSFT answered MichaelHan-MSFT edited

Hi @WeiZhang-3153 ,

No, it's not supported to set up a notification for a specific SharePoint document library folder using driveitem. You would get this error when trying to create the subscription for the folder diveItem:

57220-image.png

And according to the documentation: https://docs.microsoft.com/en-us/graph/api/resources/webhooks?view=graph-rest-1.0

Only driveItem on OneDrive for Business is supported to set up notifications. The supported resource paths are only:

  /drives/{id}/root
 /users/{id}/drive/root


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.






image.png (69.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.