首页 > 解决方案 > 图表查询不再支持 accountEnabled 过滤器

问题描述

我们有一个用户查询访问/beta了过去几个月一直在工作的端点,并且在过去几天的某个时候,它已经停止工作并返回 Authorization_RequestDenied 错误。

使用Graph Explorer,我将其缩小到使用accountEnabled eq truefilter 子句。如果我删除此过滤器子句,则查询将起作用。

完整的查询是:

https://graph.microsoft.com/beta/users?$filter=(startswith(givenName,%27sim%27)%20or%20startswith(surname,%27sim%27)%20or%20startswith(displayName,%27sim%27))%20and%20accountEnabled%20eq%20true&$select=id,userPrincipalName,givenName,surname,displayName,mail,userType

我进行了快速搜索,但在更改日志中没有找到任何内容。

确切的错误是:

{
    "error": {
        "code": "Authorization_RequestDenied",
        "message": "Insufficient privileges to complete the operation.",
        "innerError": {
            "request-id": "d04d57d3-6e43-4e73-860a-ef721636929b",
            "date": "2018-05-12T20:02:57"
        }
    }
}

标签: jsonazure-active-directorymicrosoft-graph-api

解决方案


列表用户 API获取。

重要提示:Microsoft Graph 中 /beta 版本下的 API 处于预览状态,可能会发生变化。不支持在生产应用程序中使用这些 API。

我无法使用您提供的完整查询来重现它。它在我这边正常工作。

在此处输入图像描述


推荐阅读