无法使用列表中O365图形API
问题描述:
上周开始为PointPublishing Hub站点驱动器集合,试图检索drive
收集某些类型的sites
当微软图形功能发生了变化。无法使用列表中O365图形API
尝试使用App-Only Auth令牌为PointPublishing Hub
站点列出drive
收集时,会返回401 unauthenticated
错误。
这是我所看到的:
我首先搜索在我的SharePoint实例站点的列表:
GET https://graph.microsoft.com/v1.0/sites?search=
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"createdDateTime": "2015-05-22T17:20:49Z",
"id": "mysiteid",
"lastModifiedDateTime": "0001-01-01T08:00:00Z",
"name": "hub",
"webUrl": "https://mysite/portals/hub",
"root": {},
"siteCollection": {
"hostname": "mysite"
},
"displayName": "PointPublishing Hub Site"
}
]
}
该网站存在,其实我可以找到它。它看起来像某种用于Office 365视频的System站点。
我可以使用API检索站点的元数据:
GET https://graph.microsoft.com/v1.0/sites/mysiteid
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
"createdDateTime": "2015-05-22T17:20:49Z",
"description": "",
"id": "mysiteid",
"lastModifiedDateTime": "2017-11-25T14:28:55Z",
"name": "hub",
"webUrl": "https://mysite/portals/hub",
"root": {},
"siteCollection": {
"hostname": "mysite"
},
"displayName": "PointPublishing Hub Site"
}
一切正常为止。现在,我尝试得到drive
收藏列表:
https://graph.microsoft.com/v1.0/sites/mysiteid/drives
{
"error": {
"code": "unauthenticated",
"message": "Access denied. You do not have permission to perform this action or access this resource.",
"innerError": {
"request-id": "d7e18e09-858f-41c7-aec2-9c962b9dc446",
"date": "2017-11-25T14:42:31"
}
}
}
client-request-id →d7e18e09-858f-41c7-aec2-9c962b9dc446
request-id →d7e18e09-858f-41c7-aec2-9c962b9dc446
设计现在这还是一个回归?我应该能够获得这些类型网站的驱动器集合列表吗?
答
当我们修复了一个限制结果仅包含template=DocumentLibrary
而不是baseType=DocumentLibrary
的问题时,我们在驱动器枚举中做了回归。如果您仍然发现此方案出现故障,请通过对此答案的评论告知我们。
我目前正在将我们的SharePoint Online连接代码库中的一个移植到Graph API,并且我也遇到了同样的问题! 上周三,'/ sites/root/drives'端点功能正常。今天,我们的质量检查小组中的一位测试人员报告说,它不再有效。 – danjarvis
我继续并在此提交了[问题](https://github.com/microsoftgraph/microsoft-graph-docs/issues/2004)。 @ruelloehr – danjarvis