How to use Microsoft Graph Explorer to retrieve all the folders from a SharePoint Document Library. Don't list out all the individual files or children within the folder.

Jackson Teo 0 Reputation points
2023-07-24T08:18:05.04+00:00

How to use Microsoft Graph Explorer to retrieve all the folders from a SharePoint Document Library. Don't list out all the individual files or children inside the folders.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,935 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. TH-4749-MSFT 3,360 Reputation points
    2023-07-31T16:05:19.7866667+00:00

    Hi Jackson Teo,

    Thanks for reaching out. You can append the '?$filter=folder+ne+null' filter after the Graph query URL to filter Document Library by folders in that library. You can find more information on listing items here https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http. These queries will not recurse folders and list only items in the path mentioned in the query URL.

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

    Thanks.