Retrieve SharePoint groups (owner, members, visitors) from MSGraph API

Narinder Paul 41 Reputation points
2024-01-29T15:57:54.4266667+00:00

Hi,
In a SharePoint site, we have site members that we can fetch directly from Graph Api.
SharePoint has other groups of users that are listed in Settings > Site Permissions. In that we have list of Owners, Members, Visitors). Is there any way we can fetch these groups using graph Api.

https://learn.microsoft.com/en-us/answers/questions/1193879/retrive-sharepoint-sites-group-member-via-graph-ap A similar question was raised and answered. But it is not updated Mar 28, 2023.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,943 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,647 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Diah.Karim-MSFT 330 Reputation points Microsoft Vendor
    2024-01-30T01:59:51.17+00:00

    Hi Narinder

    To get the SharePoint site group name using Microsoft Graph API, you can try it from Ms Graph Explorer and later try to use call the MS Rest API from apps.

    Please note that by default, MS Graph API has not exposed such endpoints to access SharePoint site groups. However, you can consider using the alternative method of accessing the hidden list “User Information List” that stores users (including groups) information. You can get the group name through this list. The endpoint is: https://graph.microsoft.com/v1.0/sites/{siteid}/lists/User Information List/items?expand=fields You may filter further or iterate based on the object content-type "SharepointGroup'

    Here is sample screenshot.

    User's image

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  2. RaytheonXie_MSFT 35,236 Reputation points Microsoft Vendor
    2024-01-30T02:06:54.6133333+00:00

    Hi @Narinder Paul, After searching the document of graph api, there is no dedicated endpoint in Microsoft Graph to get SharePoint Group permissions or their members currently. If you want to get the list of all users & groups in SharePoint site, you can query "User Information List" like:

    https://graph.microsoft.com/v1.0/sites/{siteid}/lists/User Information List/items?expand=fields
    

    Check below links for more information:

    1. How to get sharepoint site group name using Graph API?
    2. Get SharePoint Groups (not AD groups) using Graph API

    ---If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.