I was sure about after reading Microsoft document that I can filter the group members using OData Query Parameters because https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/group_list_members
Request GET URL - https://graph.microsoft.com/v1.0/groups/{groupId}/members?filter= startswith(givenname,'V')
In above URL groupId is used from https://graph.microsoft.com/v1.0/groups
but when I try to get the result using Graph Explorer (https://developer.microsoft.com/en-us/graph/graph-explorer) using my work account login, it's not working.
Also I have tried to use this in SDK (I have implemented graph API in my code using Microsoft graph API SDK) and still got same error.
And gives below error -
{ "error": { "code": "Request_UnsupportedQuery", "message": "The specified filter to the reference property query is currently not supported.", "innerError": { "request-id": "96f3ffef-56f5-42e3-82f2-64813106b729", "date": "2018-02-13T10:59:39" } } }
Is this because "members" is not a resource type ? so it does not have properties and so we can not filter this result ?
If so then is there any other way we can get filtered group members ?
Also posted issue on Github - https://github.com/microsoftgraph/microsoft-graph-docs/issues/2239
directoryObject
s. Even though theuser
resource inherits fromdirectoryObject
, you can't filter ongivenName
here. You would have to do client-side filtering to search for specific members. – RasmusW