I want to get all the members of a mail group using Outlook/Office 365 REST API.
For example: name: #allusers email: [email protected]
I want list down all the members of the #allusers group.
What is the API call would do this?
I want to get all the members of a mail group using Outlook/Office 365 REST API.
For example: name: #allusers email: [email protected]
I want list down all the members of the #allusers group.
What is the API call would do this?
You should use the "Get member objects" call of a group. (https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/directoryobject_getmemberobjects).
If you are new to the Microsoft Graph API, I recommend that you check out the Graph Explorer to get a feel for the structure of the objects that you can retrieve and manipulate using the API.
In the demo tentant of the Graph Explorer, for example, this URL will return group members of one group: https://graph.microsoft.com/v1.0/groups/22be6ccb-15a5-459f-94ac-d1393bdd9e66/members
There is a solution for this that is we can get the Group ID from the group mail address.using
https://graph.microsoft.com/v1.0/groups/?$filter=mail+eq+'[email protected]
By next using the ID we can get the group user details (mail) using
https://graph.microsoft.com/v1.0/groups/91234b-43c6-4435-ac69-02b8e0cc6570/members?$select=mail,displayName
But here has a problem that is I don`t know how to get the next page of the result :-(
If you know the solution for find the next page kindly let me know!