Folder Download using Graph API

Nilesh Karotra 0 Reputation points
2025-03-05T06:46:16.5833333+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

JSONCopy

{
    "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 Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Rajat Vashistha-MSFT 1,690 Reputation points Microsoft External Staff
    2025-03-05T09:23:34.2166667+00:00

    Hi Nilesh Karotra,

    Thanks for reaching out to Microsoft!

    I tried to replicate the scenario on my end and successfully downloaded zip folders using the Graph API endpoint {sites/{site-id}/drives/{drive-id}/items/{id}/content}.

    Could you please try running this endpoint without the filter (?format=zip) and observe the behavior?

    Currently, the Microsoft Graph API does not support downloading an entire folder from a SharePoint site. You can only download zip folders. However, you can upvote this feature request idea, and based on the number of votes received, the Microsoft Engineering team may consider it for future implementation.

    If you are looking to download a file uploaded in a document library (driveitem-get-content.). You can use the following Graph API endpoints. These will include the @microsoft.graph.downloadUrl property in the DriveItem:

    GET /sites/{site-id}/drives/{drive-id}/root:/{path-relative-to-root}:/content  
    GET /sites/{site-id}/drives/{drive-id}/items/{item-id}/content  
    
    

    Hope this helps.

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

    1 person found this answer helpful.
    0 comments No comments

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.