1

I am trying to get my drive items from OneDrive by following the code snippets in Microsoft Graph Explorer. I am using the sample app provided by Microsoft's quick start (https://developer.microsoft.com/en-us/graph/quick-start)

this is the call I am reviewing:

https://graph.microsoft.com/v1.0/me/drive/root/children

var result = await graphClient.Drives["{drive-id}"].Items["{driveItem-id}"].Children.GetAsync();

The {drive-id} is straight forward but what is expected for {driveItem-id}?

In Graph Explorer I can use https://graph.microsoft.com/v1.0/me/drives in order to fetch my available drives (there is only 1) but there is only 1 relevant ID in my response.

Clarification would be appriciated

Thanks!

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
cmf91
  • 33
  • 5

1 Answers1

1

/drive/root is a shortcut for /drive/items/root so the driveItem-id can be replaced with root to make a call to get children in the root folder.

var result = await graphClient.Drives["{drive-id}"].Items["root"].Children.GetAsync();
user2250152
  • 14,658
  • 4
  • 33
  • 57