Welcome to the Microsoft Q&A Platform!
Thank you for reaching out with your query about fetching user details by email ID and retrieving group members via the Microsoft Graph API.
Fetch User Details
You can use the Microsoft Graph API to get user details by providing the user's email ID. Here's an example:
GET https://graph.microsoft.com/v1.0/users/{email}
Replace {email}
with the email address of the user you wish to retrieve details for. This API call returns a JSON object containing the user's details, such as their display name, job title, and other attributes.
Fetch Members of a Group
To fetch the members of a specific group, you can use the following API:
GET https://graph.microsoft.com/v1.0/groups/{group-id}/members
Replace {group-id}
with the group's unique ID. This call retrieves a JSON object listing the group's members, including their display names and email addresses.
Fetch All Groups
To retrieve a list of all groups in your organization, you can use:
GET https://graph.microsoft.com/v1.0/groups
This returns a JSON object containing all groups, with details such as their display names and email addresses.
Authentication and Authorization
To use the Microsoft Graph API, you'll need to authenticate and authorize your application using Azure Active Directory. Ensure your app has the following permissions:
-
User.Read.All
(for user details) -
Group.Read.All
(for group and member data)
For further details, refer to the official Microsoft documentation:
Microsoft Graph API - Get User
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.