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

Verschraege Tom 26 Reputation points
2021-07-05T15:19:10.33+00:00

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

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,672 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,702 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,676 questions
0 comments No comments
{count} vote

Accepted answer
  1. Deva-MSFT 2,256 Reputation points Microsoft Employee
    2021-07-08T09:58:51.163+00:00

    @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.


2 additional answers

Sort by: Most helpful
  1. 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.

    0 comments No comments

  2. 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-06e937237652

    Time stamp: 6/07/2021 7:45:49 +00:00