I’m currently working on webhook notification for SharePoint Online drive using MS Graph API. The subscription is already setup as bellow.
POST https://graph.microsoft.com/v1.0/subscriptions
{
"changeType": "updated",
"notificationUrl": "https://a123bluhbluh.ngrok-free.app/api/WebHook",
"resource": "/drive/root",
"expirationDateTime": "2024-07-01T00:00:00Z",
"clientState": "c9a46c1f-9d7d-4e2b-80d3-4b18a0d0d4ae"
}
Whenever I make any change in the drive by adding/deleting a file I get a notification but the resourceData is null (I only get OdatType).
{"value":[
{"subscriptionId":"XXX",
"clientState":"c9a46c1f-9d7d-4e2b-80d3-4b18a0d0d4ae",
"tenantId":"XXX",
"resource":"drives/root",
"resourceData":{
"@odata.type":"#Microsoft.Graph.DriveItem",
"Id" : null,
"ODataEtag" : null,
"ODataId" : null
},
"changeType":"updated",
"subscriptionExpirationDateTime":"2024-07-01T00:00:00Z"
}
]
}
I also tried adding "includeResourceData": true
to my subscription but failed (It seems like includeResourceData is not vaild for sharepoint).
I really need file(item) ID for other function. Everyone Please help me!!