[英]Microsoft Graph API, Region is required when request with application permission
I am trying to access Microsoft Graph API to search the list items present in tenant.我正在尝试访问 Microsoft Graph API 以搜索租户中存在的列表项。 I am having no problem when GET request is executed for users or groups.为用户或组执行 GET 请求时我没有问题。
When I post the request for search using HttpClient as described on MS site.当我按照 MS 站点上的描述使用 HttpClient 发布搜索请求时。 I am getting below error.我得到以下错误。
Failed to call the web API: BadRequest Content: {"error":{"code":"System.Exception","message":"SearchRequest Invalid (Region is required when request with application permission.)\r\nRegion is required when request with application permission.","target":"","details":null,"warnings":null,"level":"Error","httpCode":400},"Instrumentation":{"TraceId":null}}调用 web 失败 API: BadRequest Content: {"error":{"code":"System.Exception","message":"SearchRequest Invalid (Region is required when request with application permission.)\r\nRegion is required当请求具有应用程序权限时。","target":"","details":null,"warnings":null,"level":"Error","httpCode":400},"Instrumentation":{"TraceId" :无效的}}
I tried with.Net core as well.我也尝试过使用.Net core。 same error.同样的错误。 If i paste access code on HTML file, calling api for search using Ajax is working fine.如果我在 HTML 文件上粘贴访问代码,调用 api 进行搜索,使用 Ajax 工作正常。
what code i am missing in my c# code.我的 c# 代码中缺少什么代码。
The reason should be this endpoint you use not support application permission.原因应该是您使用的这个端点不支持应用程序权限。
Usually this error message is encountered, indicating that application permission is not supported, you can use delegated permissions.一般遇到这个错误信息,说明不支持应用权限,可以使用委托权限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.