LookingSharp
LookingSharp

Reputation: 123

Using the Microsoft Graph how do I look up a group by email address?

I'm using the Graph Explorer to play with the Microsoft Graph. I understand you can access a group by specifying its id, like so -

https://graph.microsoft.com/v1.0/groups/14481298-e121-4d97-91d5-3fe555aa2871

and you can get its members as well like this -

https://graph.microsoft.com/v1.0/groups/14481298-e121-4d97-91d5-3fe555aa2871/members

But it isn't clear to me how you lookup a group by its email address and list the members in one call. I now know, so I thought I would share, and also ask if there is a better way.

Upvotes: 3

Views: 3778

Answers (1)

LookingSharp
LookingSharp

Reputation: 123

To get the group by email you can filter by the mail property. However this does return an array, which is slightly different from the original query.

https://graph.microsoft.com/v1.0/groups/?$filter=mail+eq+'[email protected]'

To get the members you can expand members.

https://graph.microsoft.com/v1.0/groups/?$filter=mail+eq+'[email protected]'&$expand=members

Upvotes: 4

Related Questions