11

I'm working on accessing document libraries for Sharepoint sites via Mircosoft Graph, but haven't had any luck so far.

Here is my setup:

I have two sites

https://mydomain.sharepoint.com

https://mydomain.sharepoint.com/teams/MyTestSite

When I make an api call to https://graph.microsoft.com/v1.0/drives, the response doesn't contain id of document library for second site (https://mydomain.sharepoint.com/teams/MyTestSite).

I have gone through documentation and haven't found anything on how to accomplish this. If anyone got any idea about this, please share.

Thanks.

4

3 回答 3

3

我能够为此找到解决方案。共享点站点在 Office 365 中表示为一个组。我通过一些尝试和试验发现了这一点。

在此处输入图像描述

因此,在查找了与 a 相关的任何文档后Group,我得到了这个:https ://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/group

而且,通过使用List groups端点,我终于能够获得经过身份验证的用户可以访问的所有 Sharepoint 站点的列表。

此 API 调用Group.Read.All在请求访问令牌时需要范围,并且只有管理员用户才能授权此范围。因此,这将需要一个单独的界面供管理员列出组,可能将组用户映射存储在我的应用程序上,以便用户能够进行 api 调用 (/groups/{group-id}/drive/items/{item -id}) 与驱动器相关。

于 2017-04-07T06:53:30.743 回答
1

V1.0 API 可以按如下方式列出您的 doc lib

GET https://graph.microsoft.com/v1.0/sites/mydomain.sharepoint.com:/Teams/MyTestSite:/drives

希望这可以帮助。

于 2017-08-10T17:33:58.607 回答
0

betaAPI 还公开了一个Sharepoint端点

如果您已经知道您的站点结构,您也可以使用该路径:

GET https://graph.microsoft.com/beta/sharepoint:/sites
于 2017-04-12T18:21:29.330 回答