Using Azure Graph API to Retrieve User Details by Id, but "Email Addresses" Attribute is Missing

Shashank Singh 0 Reputation points
2024-07-19T02:00:15.1033333+00:00

I am using the Azure Graph API to retrieve user details by their Id, but I am unable to obtain the value of the "Email Addresses" attribute, which is of the StringCollection data type. I have successfully retrieved other attributes, but the "Email Addresses" field is consistently missing from the response. Here is a screenshot of User Attributes.

How can I properly retrieve the "Email Addresses" attribute using the Azure Graph API? If there are specific query parameters or configurations required, please provide detailed instructions.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,228 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 6,340 Reputation points Microsoft Vendor
    2024-07-19T06:55:25.0366667+00:00

    Hi @Shashank Singh

    According to the document, all the attributes that can be accessed by the user are listed. After searching, the Email Addresses attribute is not found. In addition to the Email attribute, there is another other email attribute, we are not sure if this is what you need, please try to get the property as follows:

    GET /users?$select=userPrincipalName,otherMails
    

    Hope this helps.

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


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.