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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,049 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.
3,290 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 50,006 Reputation points Microsoft Vendor
    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.

    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.