1

I have been trying to iterate through items under a document lib and a folder under a document lib in Sharepoint using Microsoft Graph API V1.0 and Beta too.

I can list doc lib using following request:

https://graph.microsoft.com/v1.0/sites/mysite.sharepoint.com:/FOA/BD:/drives

but I can't iterate through items under a specific drive under above path.

After a long research I tried with beta all the way to list all items under a drive still no result:

https://graph.microsoft.com/beta/sites/mysite.sharepoint.com:/foa/bd:/lists/Budget/

I followed Get an item in a list, but still no success.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ravi Anand
  • 5,106
  • 9
  • 47
  • 77
  • Ravi, to enumerate the children in a drive, you need to access the children collection of the drive... something like this: ```https://graph.microsoft.com/v1.0/sites/mysite.sharepoint.com:/FOA/BD:/drives/{drive-id}/root/children``` Is that what you're doing? Are you getting an error when trying this? – Ryan Gregg Aug 16 '17 at 21:30
  • will check and let you know. – Ravi Anand Aug 16 '17 at 22:32
  • i tried with suggested url as follows:(no success only errors) https://graph.microsoft.com/v1.0/sites/mydoamin.sharepoint.com‌​:/FOA/BD:/drives/b!VCvM../root/childre‌​n https://graph.microsoft.com/v1.0/sites/mydoamin.sharepoint.com‌​:/FOA/BD:/drives/budget/root/childre‌​n – Ravi Anand Aug 17 '17 at 16:35

1 Answers1

3

You are close. Using the first link getting the list of drives, copy the drive-id of the drive which you want to retrieve the documents. Then you would use the following endpoint:

https://graph.microsoft.com/v1.0/drives/{drive-id}/root/children

I answered a similar question with more detail for getting children items using Graph v1.0.

Brian Smith
  • 1,467
  • 15
  • 31