通过Microsoft Graph API写入Excel电子表格--无法获得WAC访问令牌。

问题描述 投票:0回答:1

我正试图更新位于 Business OneDrive 根目录下的现有电子表格。

我可以运行GET并检索文件详细信息。

我被授权为应用程序,而不是授权。

每当我运行下面的POST,

https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/demo.xlsx

我都会收到这个错误

{
  "error": {
    "code": "AccessDenied",
    "message": "Could not obtain a WAC access token.",
    "innerError": {
      "request-id": "07422c42-930f-4329-809a-93103bff3ab4",
      "date": "2020-05-14T18:32:46"
    }
  }
}

我还将Files.ReadWrite.All设置为应用程序。

我一直在使用以下文档寻求帮助。

https:/docs.microsoft.comen-usgraphapiresourcesexcel?view=graph-rest-1.0。

显然会话不是强制性的,默认情况下它们是持久化的--这正是我想要的 (https:/docs.microsoft.comen-usgraphapiworkbook-createsession?view=graph-rest-1.0&tabs=http。)

我已经通过Postman运行了GET和POST请求。

api microsoft-graph azure-ad-graph-api
1个回答
0
投票

要使用 Excel 资源,需要以下权限范围之一。

Files.Read (for read actions)

Files.ReadWrite (for read and write actions)

你需要添加这个权限并给管理员同意。enter image description hereenter image description here

© www.soinside.com 2019 - 2024. All rights reserved.