Onedrive Webhook subscription Issue.
Hello Team.
Topic
If you use https://graph.microsoft.com/v1.0/subscriptions , you will fail subscription, and if you use https://graph.microsoft.com/beta/subscriptions , you will succeed subscription.
Expect
https://graph.microsoft.com/v1.0/subscriptions is working
Problem
I am trying to set up a webhook subscription to update the status of a folder in OneDrive.
The problem is that while it fails with the error message at https://graph.microsoft.com/v1.0/subscriptions.
POST https://graph.microsoft.com/v1.0/subscriptions
Body:
{
"changeType": "updated",
"expirationDateTime": "2024-05-14T23:14:41.579Z",
"notificationUrl": "https://auto...",
"resource": "me/drive/root",
"lifecycleNotificationUrl": "https://auto..."
}
it's response is
{
"body": {
"error": {
"code": "ExtensionError",
"innerError": {
"client-request-id": "951643f7-c439-4b99-82f5-1c57c7802965",
"date": "2024-05-14T07:44:53",
"request-id": "951643f7-c439-4b99-82f5-1c57c7802965"
},
"message": "Operation: Create; Exception: [Status Code: Unauthorized; Reason: Authentication failed]"
}
},
"header": {
"Cache-Control": "no-cache",
"Content-Type": "application/json",
"Date": "Tue, 14 May 2024 07:44:53 GMT",
"Strict-Transport-Security": "max-age=31536000",
"Transfer-Encoding": "chunked",
"client-request-id": "951643f7-c439-4b99-82f5-1c57c7802965",
"request-id": "951643f7-c439-4b99-82f5-1c57c7802965",
"x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"West US\",\"Slice\":\"E\",\"Ring\":\"4\",\"ScaleUnit\":\"004\",\"RoleInstance\":\"BY3PEPF0001058A\"}}"
},
"status-code": 401
}
BUT, it works fine using https://graph.microsoft.com/beta/subscriptions. (Beta version of API) -> OK.
I request the body values as follows and included the permissions(Files.ReadWrite.All) you require.
Please check why this is happening and I await your response.