Microsoft Graph API-Office 365访问SharePoint嵌套文件夹项目 [英] Microsoft Graph API - Office 365 Access SharePoint Nested Folder Items

查看:61
本文介绍了Microsoft Graph API-Office 365访问SharePoint嵌套文件夹项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被共享访问Office 365网站上的SharePoint文件夹.

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

图片"文件夹中有一个JPG列表.

Inside the "Images" folder are a list of JPGs.

如何使用Graph API访问此深度嵌套的文件夹?

How can I use the Graph API to access this deeply nested folder?

我尝试过类似的事情:

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.

推荐答案

引用路径的格式如下:

/v1.0/sites/root/drive/root:/{folder path}:/children

使用您的示例,我们有以下内容:

Using your example we have the following:

  1. https://graph.microsoft.com/v1.0/sites/root返回SharePoint租户的根网站.

  1. https://graph.microsoft.com/v1.0/sites/root returns the root site of your SharePoint tenant.

/drive/root返回Site的默认Drive.在这种情况下,/Documents实际上不是文件夹",它是根SharePoint的默认驱动器

/drive/root returns default Drive for the Site. In this case, /Documents isn't actually a "folder", it's the default Drive for your root SharePoint

:{folder path}:应该替换为您要查找的文件夹的路径.在这种情况下,/Marketing/Company/Images.第一个:运算符告诉SharePoint将以下字符串视为文件路径.第二个:告诉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返回文件夹中的DriveItem资源列表.

/children returns a list of DriveItem resources within the folder.

因此,您完整的URI应该看起来像这样:

So you're complete URI should look something like this:

/v1.0/sites/root/drive/root:/Marketing/Company/Images:/children

这篇关于Microsoft Graph API-Office 365访问SharePoint嵌套文件夹项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆