You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:MS Graph API中$filter对Identities属性过滤无效

MS Graph API 中 identities 属性 $filter 无效问题解决

问题描述

尝试在MS Graph API中对identities属性使用$filter过滤时,返回200状态码但无数据返回,已确认参数值存在于数据中,在官方API测试工具中执行同样查询也得到相同结果。

原因分析

identities是集合类型属性,直接使用普通eq运算符无法正确匹配集合内的元素,必须用集合运算符any()遍历集合项并指定匹配条件。

正确查询示例

假设要过滤issuer为contoso.com且issuerAssignedId为user1@contoso.com的对象,正确过滤语句如下:

GET https://graph.microsoft.com/v1.0/users?$filter=identities/any(i:i/issuer eq 'contoso.com' and i/issuerAssignedId eq 'user1@contoso.com')

注意事项

  • 必须同时指定issuer和issuerAssignedId,因为identities中的每个条目由这两个属性唯一标识
  • 确认权限足够:调用users端点并使用$filter需要User.Read.All或更高权限
  • 检查参数大小写:部分环境中字符串匹配大小写敏感,需确保参数值与实际数据完全一致

查询场景截图

内容的提问来源于stack exchange,提问作者Harshal Jadhav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 03:29:55