office365webhooksoffice365apimicrosoft-graph-apioffice365-restapi

Are app-only tokens already available for Microsoft Graph API webhooks?


I'm trying to retrieve information via a webhook, regarding User's OneDrives on a Tenant, using an app-only token, and the Microsoft Graph API.

The problem I'm having is that the Microsoft Graph Explorer keeps returning me an undefined error in an 500 response, that gives me little information, when creating a new subscription:

{
    "error": {
        "code": "",
        "message": "An error has occurred.",
        "innerError": {
            "request-id": "16546770-c3b0-4d9f-8a9c-1a79fb17ffcd",
            "date": "2016-09-06T10:15:04"
        }
    }
}

This is the information I'm sending via POST to https://graph.microsoft.com/beta/subscriptions:

{
  "changeType":"updated",
  "notificationURL":"https://{URL to notification page}",
  "resource":"/drives/{User's OneDrive drive ID}/root",
  "expirationDateTime":"2016-10-20T11:00:00"
}

In previously answered questions, there was a reference (answer by Yina) about subscriptions being on a per user basis, and not being able to be created by an app-only token.

My questions are, if this is currently still true, and if using an app-only token with full access I can subscribe to User's OneDrive webhooks.

PS: I am retrieving User's OneDrives with this token, without an issue, just haven't been able to subscribe to changes in the root item of the drive.


Solution

  • At present, the WebHooks of Microsoft Graph is still only support for the delegate token.

    It means that we are not able to create the subscription using the app-only token. If you want the Microsoft Graph support this feature, you may submit the feedback from link here.