Is there a Graph Explorer API to Get the Display Image of an Outlook User Using Their Email ID?

Diksha Yadav 101 Reputation points
2024-08-02T06:41:08.5266667+00:00

Question for Microsoft Forum:

Is there a Graph Explorer API to Get the Display Image of an Outlook User Using Their Email ID?

Explanation:

I am looking for a way to retrieve the display picture of an Outlook user using their email ID via the Microsoft Graph API. Specifically, I need the display picture that is shown when one receives an email in Outlook, including the default placeholder image if the user has not set a profile picture.

Currently, I am aware that the following request returns a valid response if the user has set a profile picture:


GET /users/{userPrincipalName}/photo/$value

However, if the user has not set a profile picture, this request does not return the default placeholder image.

Is there an API endpoint or method in Graph Explorer that allows fetching the display picture or the placeholder image as it appears in the Outlook email interface? This image should be the same as the sender's display picture or the default placeholder shown with the email.

Any guidance or suggestions would be greatly appreciated. Thank you!

Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Hitesh Pachipulusu - MSFT 3,620 Reputation points Microsoft External Staff
    2024-08-02T07:19:18.9466667+00:00

    Hello @Diksha Yadav ,

    Thank you for contacting Microsoft Support!

    To retrieve the display picture of an Outlook user using their email ID via the Microsoft Graph API, you can use the following endpoint:

    GET /users/{userPrincipalName}/photo/$value

    This request will return the user’s profile picture if they have set one. However, as you mentioned, if the user has not set a profile picture, this request will not return the default placeholder image.

    Unfortunately, there is no direct API endpoint in Microsoft Graph that returns the default placeholder image if the user has not set a profile picture. The placeholder image is typically handled by the client application (like Outlook) and is not stored or managed by the Graph API.

    Hope this helps.

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,371 Reputation points
    2024-08-02T07:27:16.1+00:00

    Hi @Diksha Yadav

    No, the Graph API can currently only handle uploaded profile pictures, not default placeholder images. If a user has not set a profile picture, the API request will return a 404 error.

    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.

    1 person found this answer helpful.

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.