Delta query on site list items not returning 'deleted' item identifiers
Hi,
I am using the https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/items/delta
endpoint to detect changes on my Sharepoint.
I can detect a newly added "Test Doc.docx" document like in this example:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.listItem)",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/sites/hello376.sharepoint.com,91d5f83c-7b6a-406b-8950-11a5907f1a92,933473aa-d33f-4442-ab20-812bfd58a8b0/lists/c181181b-01ed-42ef-bf45-d569eed50dfe/items/delta?token=NDslMjM0OyUyMzE7MztjMTgxMTgxYi0wMWVkLTQyZWYtYmY0NS1kNTY5ZWVkNTBkZmU7NjM4NzkyNjM5Njk1MzcwMDAwOzU5NTU5MzM0NzslMjM7JTIzOyUyMzA7JTIz",
"value": [
{
"@odata.etag": "\"{5DF04DCC-600D-4C71-B4EB-5D7928F31FA7},6\"",
"createdDateTime": "2025-04-03T07:59:17Z",
"eTag": "\"{5DF04DCC-600D-4C71-B4EB-5D7928F31FA7},6\"",
"id": "11",
"lastModifiedDateTime": "2025-04-03T07:59:24Z",
"webUrl": "https://hello376.sharepoint.com/Documents%20partages/Test%C2%A0Doc.docx",
"createdBy": {
"user": {
"displayName": "Bruno guy",
"email": "******@hello.com",
"id": "b59cd32a-e681-4197-adb3-953ed16400a4"
}
},
"parentReference": {
"siteId": "91d5f83c-7b6a-406b-8950-11a5907f1a92"
},
"contentType": {
"id": "0x010100513EFB83395ABB4EB2E17105A1CFE6EF",
"name": "Document"
},
"fields": {
"@odata.etag": "\"{5DF04DCC-600D-4C71-B4EB-5D7928F31FA7},6\"",
"id": "11",
"FileLeafRef": "Test Doc.docx",
}
}
]
}
I have activated the "Document ID" feature on my Sharepoint and I don't see the Document ID in the output (that is an issue as well).
But when I'm deleting the "Test Doc.docx" document and calling the next delta, I can only get this:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.listItem)",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/sites/hello376.sharepoint.com,91d5f83c-7b6a-406b-8950-11a5907f1a92,933473aa-d33f-4442-ab20-812bfd58a8b0/lists/c181181b-01ed-42ef-bf45-d569eed50dfe/items/delta?token=NDslMjM0OyUyMzE7MztjMTgxMTgxYi0wMWVkLTQyZWYtYmY0NS1kNTY5ZWVkNTBkZmU7NjM4NzkyNjM5OTM1MzMwMDAwOzU5NTU5MzgyNDslMjM7JTIzOyUyMzA7JTIz",
"value": [
{
"id": "11",
"parentReference": {
"siteId": "91d5f83c-7b6a-406b-8950-11a5907f1a92"
},
"fields": {}
}
]
}
I don't see anything related to the fact that an item is deleted, and I don't see which item was deleted neither.
Please note that it is not even the behavior described in the documentation:
The documentation states:
The following example shows the response that indicates that the item named
TestItemB.txt
was deleted and the itemTestFolder
was either added or modified between the initial request and this request to update the local state.
But I don't understand how I am supposed to deduce that TestItemB.txt was deleted from the following JSON:
{
"id": "3",
"parentReference": {
"siteId": "12AD05BB-59B8-43AA-9456-77C44E9BC066"
},
"contentType": {
"id": "0x00123456789abc",
"name": "Document"
},
"deleted": {
"state": "deleted"
}
}
}
And the way: what is that "id"? Is is safe to use it instead of the Document ID?
Thanks for you help.