@Verschraege Tom - Glad to hear that the issue got resolved. Unfortunately not much info available at this point what went wrong. In future when you notice such issue, report them in a new thread so that someone can investigate that.
MS Graph API (SDK) download files from Sharepoint using item[itemID].Content or using download URL returns `BadRequest` for all requests/files on different drives
The app fetches a DriveItem, and from the download url it starts a (chunked) download. This has worked fine up until a few days ago.
Getting a DriveItem still works, but then trying to download doesn't work anymore. For all requests, we get the same HTTP 400 response:
{"error":{"code":"invalidRequest","innerError":{"code":"badArgument"},"message":"One of the provided arguments is not acceptable."}}
While a few days ago, everything worked. We are having several apps accessing different SharePoint sites. They all have the same problem.
I tried changing the code, and download the file using
var stream = await graphClient.Me.Drive.Items["{driveItem-id}"].Content
.Request()
.GetAsync();
However, this throws the same error: a ServiceException with the same message as above
Related with https://learn.microsoft.com/en-us/answers/questions/463298/graph-api-generated-temporary-sharepoint-download.html
-
Deva-MSFT 2,256 Reputation points Microsoft Employee
2021-07-08T09:58:51.163+00:00
2 additional answers
Sort by: Most helpful
-
MichaelHan-MSFT 18,016 Reputation points
2021-07-06T09:49:54.66+00:00 Hi @Verschraege Tom ,
Per my test, everything works fine on my end. You could share the error info of the request (Date and request-id). I would help check the log to find more clues.
-
Verschraege Tom 26 Reputation points
2021-07-06T12:03:56.667+00:00 Hi,
Thank you for your response. I have a test case and in the response I found following info:
Client request ID: 49cfd89f-20b3-2000-f425-06e937237652Time stamp: 6/07/2021 7:45:49 +00:00