How to use user email address from Microsoft Graph API get user photo

Wendy Wang 0 Reputation points
2023-04-17T20:32:39.59+00:00

I have company employee email list, I need use email address from Graph API get their photo, I can run query get myself photo, which query can help me use email address get other user's photo from Graph API? Thank you

Microsoft Security Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. Gopinath Chennamadhavuni 2,446 Reputation points
    2023-04-18T11:51:46.5533333+00:00

    Hi @Wendy Wang,

    Thanks for reaching out.

    Using the MS Graph API: GET /users/{id | userPrincipalName}/photo/$value you can get the photo of other user. Please refer the link for more details: Get profile Photo.

    Refer the link to know about the permission required to execute this Graph API endpoints.

    Please note:

    ·       Metadata operation is not supported for personal Microsoft accounts.

    ·       There is currently a known issue with accessing group photos using application permissions.

    ·       Retrieving a user's photo using the Microsoft Graph API is currently not supported in Azure AD B2C tenants.

    Hope this helps.

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

    0 comments No comments

  2. Zehui Yao_MSFT 5,876 Reputation points
    2023-04-24T06:37:11.0233333+00:00

    Hi Wendy Wang , Since the Graph API endpoint currently only supports obtaining photos by userid or userPrincipalName, unless the user's email address is the same as userPrincipalName. Hope to help you. Best Wishes.

    0 comments No comments

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.