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

Wei Zhang 41 Reputation points
2021-01-15T21:53:33.12+00:00

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://learn.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://learn.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 Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,707 questions
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,016 Reputation points
    2021-01-18T03:11:46.92+00:00

    Hi @Wei Zhang ,

    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://learn.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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful