如何在Microsoft graph API中过滤组成员?

问题描述 投票:5回答:1

阅读Microsoft文档后,我确定可以使用OData查询参数来过滤组成员,因为https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/group_list_members

请求GET URL-https://graph.microsoft.com/v1.0/groups/ {groupId} / members?filter = startswith(givenname,'V')

在上面的URL中,从https://graph.microsoft.com/v1.0/groups使用了groupId

但是当我尝试通过工作帐户登录名使用Graph Explorer(https://developer.microsoft.com/en-us/graph/graph-explorer)获取结果时,它不起作用。

而且我也尝试在SDK中使用它(我已经使用Microsoft graph API SDK在我的代码中实现了graph API,但仍然出现相同的错误。

并给出以下错误-

{ “错误”:{ “ code”:“ Request_UnsupportedQuery”, “ message”:“当前不支持对参考属性查询的指定过滤器。”, “ innerError”:{ “ request-id”:“ 96f3ffef-56f5-42e3-82f2-64813106b729”, “ date”:“ 2018-02-13T10:59:39” } }}

这是因为“成员”不是资源类型吗?因此它没有属性,因此我们无法过滤此结果?

如果是,那么还有其他方法可以获取已过滤的组成员吗?

也在Github上发布了问题-https://github.com/microsoftgraph/microsoft-graph-docs/issues/2239

asp.net-web-api2 azure-active-directory microsoft-graph
1个回答
0
投票

[Filtering of group members现在可用as a beta API

GET https://graph.microsoft.com/beta/groups/{id}/members?$count=true&$filter=startswith(displayName, 'a')

© www.soinside.com 2019 - 2024. All rights reserved.