Sharepoint(图形)API访问OneDrive文件列表-403/404错误
使用windows上与我尝试访问的onedrive用户具有不同用户帐户的Postman,我们在Sharepoint中为onedrive用户显示了一个用户个人文件列表“我的文件”,网址为:Sharepoint(图形)API访问OneDrive文件列表-403/404错误,sharepoint,onedrive,Sharepoint,Onedrive,使用windows上与我尝试访问的onedrive用户具有不同用户帐户的Postman,我们在Sharepoint中为onedrive用户显示了一个用户个人文件列表“我的文件”,网址为: https://xxxxxxxxxuk-my.sharepoint.com/personal/rob_xxxxxxxxxlimited_com/_layouts/15/onedrive.aspx 我已经在这里注册了一个加载项 https://xxxxxxxxxuk-my.sharepoint.com/pers
https://xxxxxxxxxuk-my.sharepoint.com/personal/rob_xxxxxxxxxlimited_com/_layouts/15/onedrive.aspx
我已经在这里注册了一个加载项
https://xxxxxxxxxuk-my.sharepoint.com/personal/rob_xxxxxxxxxlimited_com/_layouts/15/appregnew.aspx
我生成了一个clientid,secret,App Domain=localhost,重定向url=https://localhost
我已在同一位置授予appinv.aspx权限,单击“信任它”:
我通过访问client.svc获得了租户和资源。我可以获得一个包含所有这些信息的访问令牌,没有问题:
grant_type client_credentials
client_id xxxxxxx-dbce-4a7e-bfd4-b7954546d4f8@xxxxxxx-f51f-4360-8e47-8ac7c82aecf7
client_secret xxxxxxx9SDjt6ELYGS4PP5NFLWxCnAWDSvxiH78fzDE=
resource 00000003-0000-0ff1-ce00-000000000000/xxxxxxxxuk-my.sharepoint.com@xxxxxxx-f51f-4360-8e47-8ac7c82aecf7
返回的访问令牌似乎正常工作-最初我们得到的令牌类型是不允许的,但我们在powershell中运行了此操作,并且排除了该错误:
设置SpoteNat-DisableCustomAppAuthentication$false
我想做的是在这个位置获得一个文件和文件夹的列表,并最终深入到“Recordings”文件夹并下载项目。我不确定语法
https://xxxxxxxxxuk-my.sharepoint.com/personal/rob_xxxxxxxxxlimited_com/_layouts/15/_api/web/lists/getbytitle('My files')/items
这返回一个404。我正在使用授权:持有人eyJ。。。如前面步骤所述,接受application/json;odata=详细的标题
同样的404
https://xxxxxxxxxuk-my.sharepoint.com/personal/rob_xxxxxxxxxlimited_com/_layouts/15/_api/web?$select=Title
有人能帮我解释一下为什么我会得到这个吗?是否有一个更基本的API请求对该文件夹来说更像是“hello world”
这些URL不同,我得到一个403您没有权限:
https://xxxxxxxxxuk-my.sharepoint.com/_api/web/lists/getbytitle('My files')/items?$select=Title
https://xxxxxxxxxuk-my.sharepoint.com/_api/web?$select=Title
在使用凭据流时,您可能需要向注册的应用授予应用权限:
发送Api请求:
更多参考资料:
BR谢谢。这里有很多细节,看起来我们正在尝试这项权利,但我会仔细检查你的。将“hello world”的最终url设置为[sharepoint]/\u api/web/List非常好。我目前正在对powerscript进行一些调查,看看它是否与用户帐户有关。
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
</AppPermissionRequests>