Getting Azure Groups from REST API
In this post we’ll look at getting Azure Groups from REST API service SharePoint Online. This can then be used to iterate through all of the members in the group allowing us to extract individual information about the users. Great for use in SharePoint Workflows where Sharepoint groups aren’t appropriate.
Using the token obtained from the steps outlined in the post “Setting up app access from SharePoint to Azure Active Directory via Microsoft’s Graph” we can now request a list of all groups in a tenancy which we can then use to extract the users from the group.
Firstly we will need to create a GET request using the web the address below:
We then need to add in the following headers
Content-Type : application/json
Authorization: Bearer TOKENfromABOVEpostGOEShere
An example of how it will look in PostMan:
The returned results will be JSON format and contain a list of all groups in the Azure AD tenancy