如何使用 Microsoft Graph API 按分配的计划筛选用户

azb*_*b.1 2 azure-active-directory microsoft-graph-sdks microsoft-graph-api

我正在尝试下面的请求。按分配计划属性中的 servicePlanId 过滤用户,尝试过滤“电话系统”计划。

https://graph.microsoft.com/beta/users?$filter=assignedPlans/any(x:x/servicePlanId eq 4828c8ec-dc2e-4779-b502-87ac9ce28ab7)
Run Code Online (Sandbox Code Playgroud)

并在响应正文中收到下面给出的错误消息。

"message": "Complex query on property assignedPlans is not supported.",
Run Code Online (Sandbox Code Playgroud)

MS-Graph-Explorer 链接 我如何以这种方式过滤用户?有什么方法可以使用 ms-graph-java-sdk 实现此目的吗?

bay*_*wet 5

这是当前 API 的限制。有一个更新的引擎允许更复杂的查询。要访问它,您需要添加ConsistencyLevel带有值的标头eventual并添加$count=true为查询参数。

这是带有新查询的图形浏览器的链接