简体   繁体   English

Microsoft Graph API,申请权限时需要Region

[英]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.

相关问题 Microsoft.Graph 库需要应用程序 AddPassword 和 RemovePassword 的权限 - Microsoft.Graph library required permission for application AddPassword and RemovePassword Microsoft graph API 代表Application请求 - Microsoft graph API request on behalf of Application Microsoft Graph API 应用程序 Collections - Microsoft Graph API Application Collections Microsoft Graph Api - 请求 Me.Photo 时无权限访问令牌 - Microsoft Graph Api -No permission acces token when asking for Me.Photo 吸引所有使用Azure Graph API的用户时需要哪些权限 - Which permission required when get all users using Azure Graph API Microsoft Graph API返回403到任何请求 - Microsoft Graph API returning 403 to any request Microsoft Graph Access令牌包含对联系人API的错误权限 - Microsoft Graph Access Token contains wrong permission for contacts API 在 Terraform 中设置 Azure AD Microsoft Graph Email API/权限 - Setting Azure AD Microsoft Graph Email API/Permission in Terraform Microsoft graph 无法从.Net 核心应用程序获取所需数据 - Microsoft graph unable to get required data from .Net core application Microsoft Graph API-AADSTS90094:授予需要管理员权限 - Microsoft Graph API - AADSTS90094: The grant requires admin permission
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM