Hi Gowtham,
We can use the SharePoint REST API below to get the current login user groups.
/_api/web/currentuser/groups
Or use Graph API below to check member groups.
/users/{id | userPrincipalName}/checkMemberGroups
More information is here: https://docs.microsoft.com/en-us/graph/api/user-checkmembergroups?view=graph-rest-1.0&tabs=http
Best Regards,
Dennis
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact
tnmff@microsoft.com.
SharePoint Server 2019 has been released, you can click
here to download it.
Click
here to learn new features. Visit the dedicated
forum to
share, explore and talk to experts about SharePoint Server 2019.