0

In the documentation Use the Microsoft Graph API to get change notifications, it says:

Using the Microsoft Graph API, an app can subscribe to changes on the following resources:

  • ...
  • Content within the hierarchy of the root folder driveItem on OneDrive for Business
  • ...

There is no explicit mention of SharePoint Online support for file notifications in the documentation, but because the OneDrive for Business and SharePoint Online APIs within the Microsoft Graph are essentially the same, should this infer that the same functionality is supported for SharePoint Online too?

0

As of June 2019, the answer is no.

There is a single endpoint in the Microsoft Graph with which you can create webhooks (subscriptions): https://graph.microsoft.com/v1.0/subscriptions

This is not specific to OneDrive for Business, but common to all applications in the Microsoft Graph (well, those that support webhooks, that is).

The Microsoft Graph Explorer is a great help to test things without writing too much code.

A successful POST to create a webhook looks something like this:

Create webhook on the Microsoft Graph

Note that the resource is me/drive/root for OneDrive for Business. There are no supported resource values for SharePoint Online at this point.


Aside

  1. OneDrive for Business only supports a changeType of updated even though created and deleted are listed as supported values in the documentation.
  2. You can GET the same URL to list current webhooks/subscriptions:

View subscriptions

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.