How do i download entire Folder from sharepoint using graph API

David 20 Reputation points
2023-12-27T09:55:08.6866667+00:00

I am trying to download a folder and everything in it using https://graph.microsoft.com/v1.0/sites/{site-id}//drive/items/{folder-id}/content

it return

{
    "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
            "date": "2023-12-27T09:45:00",
            "request-id": "e4c8522e-be20-4e46-af99-82646a00a174",
            "client-request-id": "e4c8522e-be20-4e46-af99-82646a00a174"
        }
    }
}
Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2023-12-28T07:35:30.39+00:00

    Hi @David

    Currently, the graph API does not support downloading the entire folder at once. You need to first get a list of all files in the folder, and then download the contents of each file one by one.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.