I am trying to create a new subscription for the DriveItem resource on Microsoft Graph, I have a web application that handles the Files API successfully, I have the ability to authenticate and handle the DriveItem resources succesfully.
When I am trying to create a subscription I am running into an error with the following post request
POST /beta/subscriptions HTTP/1.1
Host: graph.microsoft.com
Authorization: Bearer {{Token}}
Content-Type: application/json
{
"changeType": "created",
"notificationUrl": "{{callback}}",
"resource": "me/drive/root",
"expirationDateTime": "2022-05-01",
"clientState": ""{{state}}"",
"includeResourceData": true
}
I get the following error
{
"error": {
"code": "InvalidRequest",
"message": "Invalid 'changeType' attribute: 'created'.",
"innerError": {
"date": "2022-01-02T04:58:06",
"request-id": "REQUEST-ID",
"client-request-id": "CLIENT-REQUEST-ID"
}
}
Not sure what the problem might be, the application is registered as "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)"
I have also checked that the notificationUrl provided is valid and working, not sure what the problem might be, any help would be appreciated