Previously, I have no problem when downloading Sharepoint and OneDrive files from MS Graph API using this endpoint Download the contents of a DriveItem. But since the 3rd of July 2021, I got Error 400 when downloading the file.
I tried to hit these endpoints using Application Permission and have Files.ReadWrite.All roles
GET /sites/{siteId}/drive/items/{item-id}/content
GET /users/{userId}/drive/items/{item-id}/content
And also tried to make a request directly to the URL from @microsoft.graph.downloadUrl property and got the same Error 400 result with this body.
{
"error": {
"code": "invalidRequest",
"innerError": {
"code": "badArgument"
},
"message": "One of the provided arguments is not acceptable."
}
}
I also see something strange from the response header at docID value. Usually, it has our site id value, but this one has value like this. The 00000000-0000-0000-0000-000000000000 seems like a dummy value.
XXXXX-my.sharepoint.com_00000000-0000-0000-0000-000000000000_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Any idea what is the cause? Is there any bug? Or I should add more property to the header?
Thanks