Graph API to fetch the folder content available in sharepoint list

ajay kumar 0 Reputation points
2025-02-13T09:19:44.9233333+00:00

I am looking for graph api to fetch folder content available in sharepoint list. We are using the below API with different folder params but we are getting error message "General exception while processing". Please share an alternate or solution for this.

https://graph.microsoft.com/v1.0/sites/<SITE>.sharepoint.com,<>SITE_ID/lists/<LIST_ID>/items?$expand=fields&$filter=parentReference/id eq '139'

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 51,846 Reputation points Microsoft External Staff
    2025-02-14T01:23:43.06+00:00

    You could use Graph search to get all SharePoint items in a folder.

    Here is an example:

    POST https://graph.microsoft.com/v1.0/search/query
    {
        "requests": [
            {
                "entityTypes": [
                    "listItem"
                ],
                "query": {
                    "queryString": "parentLink:\"https://tenant.sharepoint.com/sites/emilytest/Lists/0214/1\""
                },
                "fields": [
                    "id",
                    "title",
                    "url"
                ]
            }
        ]
    }
    

    Result:

    enter image description here


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.