Diana Chira
Diana Chira

Reputation: 75

How to retrieve the GUID of SharePoint groups

I want to create an API in MS Graph to retrieve the groups: https://graph.microsoft.com/v1.0/groups/{guid_id}/members

How can I retrieve the GUID of SharePoint groups from the current sites and dynamically add it in the query?

Thanks!

Upvotes: 0

Views: 2652

Answers (1)

Shiva Keshav Varma
Shiva Keshav Varma

Reputation: 3595

You can list all Groups in your organization using

https://graph.microsoft.com/v1.0/groups 

which gives you group objects. You would get id for each object which is nothing but the GUID in your above call.

To list all Groups there is a concept of pagination where you would be getting a nextLink which can get you next set of results. See this paging document.

You can also get the groups you are member of using

https://graph.microsoft.com/v1.0/me/transitiveMemberOf/microsoft.graph.group?$count=true

which also gives you the id's of groups.

Upvotes: 1

Related Questions