【发布时间】:2019-10-08 23:45:16
【问题描述】:
我正在尝试从 Sharepoint 文档库中的文件中获取 Workbook 对象。
根据Microsoft,Excel 需要Files.Read 或Files.ReadWrite(或者,对于Sharepoint 存储的文件Sites.Read 或Sites.ReadWrite)。 Bearer 令牌的作用域如下:
"scope": "profile openid email https://graph.microsoft.com/Files.ReadWrite https://graph.microsoft.com/Sites.ReadWrite.All https://graph.microsoft.com/User.Read https://graph.microsoft.com/.default"
当我通过以下方式访问文件时: https://graph.microsoft.com/v1.0/sites/{{SiteId}}/drives/{{DriveId}}/root:/{{FilePath}}
我按预期得到了一个文件对象。
当我尝试时:
https://graph.microsoft.com/v1.0/sites/{{SiteId}}/drives/{{DriveId}}/root:/{{FilePath}}:/workbook
我明白了:
{
"error": {
"code": "AccessDenied",
"message": "Could not obtain a WAC access token.",
"innerError": {
"request-id": "52535b63-b77a-4140-b6b3-9291016c26a5",
"date": "2019-10-08T23:35:28"
}
}
}
查看around 这似乎是已修复的暂时性错误(尽管我已经解决了超过 12 小时)或权限错误。
我可以确认这可以访问存储在我的 OneDrive 上的文件的工作簿,但为什么它不适用于 Sharepoint?
我缺少什么权限?还是这是别的什么?
【问题讨论】:
标签: excel rest permissions token microsoft-graph-api