我正在尝试将文件上传到 Sharepoint。我根据应用程序提供的客户端 ID 和租户 ID 获得了 Accesstoken,并且能够做到这一点。
'client_id='||'xxxx'||'&scope='||'https%3A%2F%2Fgraph.microsoft.com%2F.default'||'&client_secret='||'xxxxxx'||'&grant_type='||'client_credentials'
令牌如下:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
基于令牌我正在尝试创建一个上传会话,它说 http1.1 403 被禁止。我有已知的站点 ID 和驱动器(项目 ID)。
HTTPResponseHeader X-Original-HTTP-Status-Line:CHARACTER:HTTP/1.1 403
Forbidden X-Original-HTTP-Status-Code:INTEGER:403 Cache-Control:CHARACTER:private
Content-Type:CHARACTER:application/json request-id:CHARACTER:1f6e2c51-5061-41c0-be0d-ee38a2c2a533
client-request-id:CHARACTER:1f6e2c51-5061-41c0-be0d-ee38a2c2a533 x-ms-ags-
diagnostic:CHARACTER:{"ServerInfo":{"DataCenter":"South Central US","Slice":"SliceC","Ring":"3","ScaleUnit":"000","RoleInstance":"AGSFE_IN_11"}}
Strict-Transport-Security:CHARACTER:max-age=31536000
Date:CHARACTER:Fri, 19 Jun 2020 17:23:53 GMT Content-Length:CHARACTER:256
应用程序已授予 Sites.readwrite 权限。All 也提供了管理员同意。任何帮助表示赞赏。