Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter group members in Microsoft graph API?

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

like image 640
vishwajeetrkale Avatar asked Feb 13 '18 11:02

vishwajeetrkale


People also ask

Is Microsoft Graph API deprecated?

Azure Active Directory (Azure AD) Graph is deprecated and will be retired at any time after June 30, 2023, without advance notice, as we announced in September, 2022.

How can multiple requests be executed in a batch request?

Individual requests can be executed in a specified order by using the dependsOn property. This property is an array of strings that references the id of a different individual request.


1 Answers

Add ConsistencyLevel: eventual to Your request header (should work for v1.0 and beta as well)

like image 97
Marcin Wojciechowski Avatar answered Jan 04 '23 07:01

Marcin Wojciechowski