1
votes

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.

1
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
will check and let you know.Ravi Anand
i tried with suggested url as follows:(no success only errors) graph.microsoft.com/v1.0/sites/mydoamin.sharepoint.com‌​:/FOA/BD:/drives/b!VCvM../root/childre‌​n graph.microsoft.com/v1.0/sites/mydoamin.sharepoint.com‌​:/FOA/BD:/drives/budget/root/childre‌​nRavi Anand

1 Answers

3
votes

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.