nkorai
nkorai

Reputation: 145

Office 365 REST API - Outlook User Photo

I'm attempting to retrieve other users' outlook photos using the Office 365 REST API (Preview). The documentation is here on this page: https://msdn.microsoft.com/en-us/office/office365/api/photo-rest-operations.

I'm able to successfully retrieve my own photo using an access token by making the following rest call:

GET https://outlook.office365.com/api/beta/me/userphoto/$value

However, when attempting to retrieve the photos of other people in my organization by using this REST call:

GET https://outlook.office365.com/api/beta/Users('{user_id}')/userphotos('{size}')/$value

I get the following error:

{
     "error": {
        "code": "ErrorAccessDenied",
        "message": "Access is denied. Check credentials and try again."
     }
}

This error isn't listed anywhere in the documentation as far as I can tell. I suspect this has something to do with the permissions in Azure but that's only a guess. Maybe it isn't supported in the preview API? Anyone have any ideas?

Upvotes: 1

Views: 923

Answers (1)

Rohit Nagarmal - MSFT
Rohit Nagarmal - MSFT

Reputation: 266

nkorai, you are right, the current permission set does not allow you to see others photo. We are adding a new oauth permission to the exchange online application endpoint which will allow you to do this. We are in the process of getting this permission enabled. Hopefully in a few weeks.

Upvotes: 3

Related Questions