You could use it like this:
graphClient.Drives["driveid"].Root.ItemWithPath("/folder3").Children.Request().GetAsync().Result;
Test result:
If the response is helpful, please click "Accept Answer" and upvote it.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I know that you can use HTTP request to get a list the children based on the Path:
GET https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/{path-relative-to-root}:/children
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["mypersonalteamsite.sharepoint.com"].Drive.Root.{what else do I need to do specify the path?}.{Children?}.Request().GetAsync();
I know I have files and folders under https://mypersonalteamsite.sharepoint.com/IT I want to get these using path.
So if I need to get file in the subfolder I can just use the path. eg. https://mypersonalteamsite.sharepoint.com/IT/mysubfolder/mysubsubfolder2/file.txt
Also if I need to get list of files & folders, I just like to use the path eg. https://mypersonalteamsite.sharepoint.com/IT/mysubfolder/mysubsubfolder2/*
There is not enough documentation on how to use GraphServiceClient object.
You could use it like this:
graphClient.Drives["driveid"].Root.ItemWithPath("/folder3").Children.Request().GetAsync().Result;
Test result:
If the response is helpful, please click "Accept Answer" and upvote it.