繁体   English   中英

如何使用MS图访问sharepoint在线站点中的文档库

[英]How to access a document library in a sharepoint online site using MS graph

我可以使用以下请求访问我的一个驱动器上的文档:

https://graph.microsoft.com/v1.0/me/drive/root/children

我能够通过以下请求访问公司的根共享点站点的文档库:

https://graph.microsoft.com/v1.0/drive/root/children

它给了我“根”库的内容:

https://<my company>.sharepoint.com/Shared%20Documents

我无法访问我创建的SP子网站的文档库。 例如这一个:

https://<my company>.sharepoint.com/samplesp/Shared%20Documents

如何使用MS Graph访问这样的文档库?

要访问SharePoint网站和列表,请查看Microsoft Graph中的SharePoint API文档。

更新:

对于那些使用MS Graph API访问特定SharePoint站点上的默认驱动器(以前称为“文档”库)有问题的用户:

您应该查看有关在OneDrive上访问文件的文档。

如问题中所述,此端点为我们提供了私有OneDrive上的文件列表:

.../me/drive/root/children

开车在SharePoint网站上的作品以同样的方式,但不是me ,你应该为你要访问的网站的全球ID( 全球编号<hostName>,<siteCollectionId>,<siteId>

总之:此端点为我们提供了指定站点的默认驱动器上的文件列表:

.../Sharepoint/sites/<hostName>,<siteCollectionId>,<siteId>/drive/root/children

如果要访问特定列表中的文件,您只需要列表的ID:

.../Sharepoint/sites/<hostName>,<siteCollectionId>,<siteId>/lists/<listId>/drive/root/children

现在应该是显而易见的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM