An API that connects multiple Microsoft services, enabling data access and automation across platforms
Downloading through Graph /beta/contentStream endpoint can work around the problem, but the original question is still unresolved.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm seeing behavior that appears inconsistent with the Microsoft Graph documentation for downloading driveItem content.
Expected behavior
According to the documentation, calling:
GET /drives/{drive-id}/items/{item-id}/content
should return a 302 Found redirect to a preauthenticated download URL, equivalent to @microsoft.graph.downloadUrl, which can be downloaded without additional authentication.
Observed behavior
GET /drives/{drive-id}/items/{item-id}
Response contains:
"@microsoft.graph.downloadUrl": "https://<tenant>.sharepoint.com/sites/<site>/_layouts/15/download.aspx?UniqueId=<guid>&Translate=false&ApiVersion=2.0"
GET /drives/{drive-id}/items/{item-id}/content
Response:
302 Found
Location:
https://<tenant>.sharepoint.com/sites/<site>/_layouts/15/download.aspx?UniqueId=<guid>&Translate=false&ApiVersion=2.0
401 Unauthorized
The URL from @microsoft.graph.downloadUrl and the Location header are identical, but the URL is not directly downloadable and requires authentication.
Questions
@microsoft.graph.downloadUrl or /content recently changed? (The failure starting mid-Sep.)@microsoft.graph.downloadUrl is a preauthenticated download URL?Additional notes
/content returns 302 successfully.401.tempauth mechanism may be deprecated, but it is unclear whether that is related to this behavior.Any clarification would be appreciated.
An API that connects multiple Microsoft services, enabling data access and automation across platforms
Downloading through Graph /beta/contentStream endpoint can work around the problem, but the original question is still unresolved.