Why is the Graph API returning different versions of a users profile pictures randomly?

Joe Jones 15 Reputation points
2024-03-11T17:42:14.11+00:00

Hi,

I'm using the Microsoft graph API documented here - https://learn.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0&tabs=http#path-parameters to get a users profile picture. But it seems if I make the same request multiple times I will eventually get a different version of the user's profile picture.

Why would the API return a different image on different requests? It returns the same image most of the time but occasionally a different one is returned. Is there a bug here or anything I can do to stop this?

The URL I'm requesting is https://graph.microsoft.com/v1.0/users/EMAIL/photos/48x48/$value replacing EMAIL with a users actual email address.

The images that are returned look mostly the same except it appears that one is a higher quality than the other. Resolution and image size are the same.

Thanks in advance!

Joe

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