Graph api not returning user profile photo

Bilal Imdad 6 Reputation points
2021-12-07T12:52:40.707+00:00

We are using following endpoint to user profile photo
https://graph.microsoft.com/v1.0/users/{userprincipalname}/photo/$value
we are getting following response
Response: {\r\n "errorCode": "ImageNotFound",\r\n "message": "Exception of type 'Microsoft.Fast.Profile.Core.Exception.ImageNotFoundException' was thrown.",\r\n "target": null,\r\n "details": null,\r\n "innerError": null,\r\n "instanceAnnotations": []\r\n}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,644 questions
{count} vote

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 37,216 Reputation points
    2021-12-08T01:54:27.567+00:00

    Hi @Bilal Imdad

    This is because your user has not yet added a photo, please add a photo for your user before obtaining it. You need to find the user in Azure AD and edit his profile.

    155739-image.png

    155776-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Preeti Teotia 96 Reputation points Microsoft Employee
    2023-04-06T15:41:18.1166667+00:00

    If profile pic is not uploaded, it should return picture of initials, but it's not returning. It's just returning error "image not found". Please help to understand, how for some users it is returning initials and for others returning error "image not found".

    0 comments No comments