Question on using GraphServiceClient to get a list of subfolder/files given a known path

Novian Winangun 1 Reputation point


I know that you can use HTTP request to get a list the children based on the Path:


But, how do you translate this to using GraphServiceClient on the server site using csharp?

For example, I am trying something like this:

var driveItems = await graphClient.Sites[""].Drive.Root.{what else do I need to do specify the path?}.{Children?}.Request().GetAsync();

I know I have files and folders under I want to get these using path.

So if I need to get file in the subfolder I can just use the path. eg.

Also if I need to get list of files & folders, I just like to use the path eg.*

There is not enough documentation on how to use GraphServiceClient object.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,087 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,021 Reputation points

    You could use it like this:


    Test result:

    If the response is helpful, please click "Accept Answer" and upvote it.

    No comments