Getting a user's photo correctly in SharePoint Online

Deleted
Not applicable

In a client-side solution, we often like to use our users photos in rollups, search results etc. and we were used to use this endpoint:

/_layouts/15/userphoto.aspx?size=M&accountname=<accountName>

 

This requires the user to have a photo in their User Profile - and it works like a charm. But after Delve arrived, we also have this new endpoint: 

/_vti_bin/DelveApi.ashx/people/profileimage?userId=<username/email>

 

Our tests shows us, that even though the user has a picture in Delve, that last endpoint just shows a silhuet (eg. no available picture) for some users - not all.

 

Our customer uses Delve and most of the users has a picture in Delve and not nessecary in the User Profile store as well. 

 

Does anyone have any experience and/or advice when using the DelveApi.ashx endpoint?

1 Reply

We encounter the exact same problem, building an overview page with profile pictures of people. 

 

Using the DelveApi.ashx we get the placeholder image for most of the other users. Some are shown.

 

Using the following Delve URL directly, we get a 401 when we are not logged in into Delve already:

https://eur.delve.office.com/mt/v3/people/profileimage?userId=user@domain.nl&UA=0&size=L

When we are logged in, in Delve, we see all their images.

 

Any thoughts?