Reputation: 79
I am trying to get the user's group(s) for Sharepoint online site using Microsoft Graph APIs. But I am not getting any equivalent graph API for the below Sharepoint rest API :
/_api/web/SiteUsers/GetByEmail('[email protected]')?$expand=Groups
I want the sharepoint groups not the AD groups. Thanks in advance.
Upvotes: 1
Views: 1566
Reputation: 351
By default, MS Graph API has not exposed such endpoints to access SharePoint site groups. You can raise User voice here for the ask so that it goes into our backlog.
Also as an alternate, you can try out the hacky way and see if it works for you.
There is a hidden list "User Information List" that stores users (including groups) information. We can get group name through this list.
API end point (GET) - 'https://graph.microsoft.com/v1.0/sites/{GUID}/lists/User Information List/items?$expand=fields'
Read documentation here on API for enumerating items in a list.
Let me know if this works for you. Thanks!
Upvotes: 1