[英]How can I fix SharePoint Resr API access error?
I'm trying to get data with SharePoint REST API but stucking with "System.UnauthorizedAccessException" error.我正在尝试使用 SharePoint REST API 获取数据,但遇到“System.UnauthorizedAccessException”错误。 How can I fix this?
我怎样才能解决这个问题?
What I did is...我所做的是...
POST https://login.microsoftonline.com/{{tenantName}}/oauth2/v2.0/token 发布 https://login.microsoftonline.com/{{tenantName}}/oauth2/v2.0/token
GET https://{{xxx.sharepoint.com}}/sites/{{sitename}}/_api/web/lists/GetByTitle('CSV')/items GET https://{{xxx.sharepoint.com}}/sites/{{sitename}}/_api/web/lists/GetByTitle('CSV')/items
With the 2nd command, I got error message like below.使用第二个命令,我收到如下错误消息。
"odata.error": { "code": "-2147024891, System.UnauthorizedAccessException", "message": { "lang": "en-US", "value": "Access denied. You do not have permission to perform this action or access this resource." "odata.error": { "code": "-2147024891, System.UnauthorizedAccessException", "message": { "lang": "en-US", "value": "访问被拒绝。您无权执行此操作或访问此资源。” }
}
Check whether the site you requested matches the scope set by app permission xml.It is possible that the scope does not match and the requested site fails to authenticate the request.检查您请求的站点是否与app权限xml设置的scope匹配。有可能scope不匹配,请求的站点验证请求失败。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.