1
votes

I am getting the drive of my sharepoint using the following which returns the drive and its ID etc

GET https://graph.microsoft.com/v1.0/sites/mycompany.sharepoint.com:/sites/mysite:/drive

However the below call returns a "Bad Request, url specified is invalid". Has anyone got any ideas on what I am doing wrong?

GET https://graph.microsoft.com/v1.0/sites/mycompany.sharepoint.com:/sites/mysite:/drive/items
1
edited original post with that informationDaniel Haughton

1 Answers

0
votes

You can get the root folders like this

GET https://graph.microsoft.com/v1.0/sites/mycompany.sharepoint.com/sites/mysite/drive/root/children

Note that mysite/drive is the default drive.

You can use

GET https://graph.microsoft.com/v1.0/sites/mycompany.sharepoint.com/sites/mysite/drives/{driveId}/root/children

to identify the specific driveId.

There's no endpoint to get all items in a drive with every file from every subfolder at once.

Here is a similar question for your reference.