i'm trying to filter members of a group with GraphClient in C#, but it doesn't work. Seems like graph 1.0 now supports the filtering of group members, but i can't filter them by displayName, or specify that i need only users.
This is example from Microsoft:
GET https://graph.microsoft.com/v1.0/groups/{id}/members/microsoft.graph.user?$count=true&$orderby=displayName&$search="displayName:Pr"&$select=displayName,id
ConsistencyLevel: eventual
https://learn.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=csharp the 5th example. Or am I writing the code in C# wrong?
List<Option> options = new List<Option>
{
new HeaderOption("ConsistencyLevel", "eventual"),
new QueryOption("$search", "displayName:Pr"),
};
members= await _graphClient.Groups[groupId]
.Members
.Request(options)
.GetAsync();
}
In this case i receive bad request that ':' is not recognized after displayName.
List<Option> options = new List<Option>
{
new HeaderOption("ConsistencyLevel", "eventual"),
};
members= await _graphClient.Groups[groupId]
.Members
.Request(options)
.Filter("displayName startsWith 'pr'")
.GetAsync();
}
In this i receive:
Microsoft.Graph.ServiceException: Code: BadRequest
Message: Invalid filter clause
I'm staying 2 days on this problem and can't find a solution :|