I was shared access to a SharePoint folder on our Office 365 site.
The folder is deeply nested. Something like:
http://mycorp.sharepoint.com
Our Docs > Marketing > Company > Images
Inside the "Images" folder are a list of JPGs.
How can I use the Graph API to access this deeply nested folder?
I've tried something like:
https://graph.microsoft.com/v1.0/sites/mycorp.sharepoint.com:/Documents/Marketing/Company/Images:/Items
I feel I'm close but I'm just not sure how to access the nested folder structure.
The format for referencing a path looks like this:
Using your example we have the following:
https://graph.microsoft.com/v1.0/sites/root
returns the root site of your SharePoint tenant./
drive/root
returns defaultDrive
for theSite
. In this case,/Documents
isn't actually a "folder", it's the default Drive for your root SharePoint:{folder path}:
should be replaced by the path to the folder you're looking for. In this case/Marketing/Company/Images
. The first:
operator tells SharePoint to treat the following string as a file path. The second:
tells SharePoint where the file path string ends./children
returns a list ofDriveItem
resources within the folder.So you're complete URI should look something like this: