Brian Kraemer
Brian Kraemer

Reputation: 453

Microsoft Graph API - Request Photo by size

I'm looking at the Microsoft Graph API Beta for Users/Photo operations documentation and I am comparing it to the Outlook REST API. In the Outlook REST Beta there is the option of retrieving a photo by size.

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

I do not see a way in Graph API to request a photo by size. Is there anyway to do this? If not, is this a planned feature?

Upvotes: 4

Views: 1674

Answers (2)

MDummy
MDummy

Reputation: 414

When using the Microsoft Graph SDK you can do it this way:

var graphClient = GetGraphServiceClient();
var photoStream = await graphClient.Users[userId].Photos["120x120"].Content.Request().GetAsync();

// or

var photoStream = await graphClient.Me.Photos["120x120"].Content.Request().GetAsync()

Upvotes: 7

Venkat Ayyadevara - MSFT
Venkat Ayyadevara - MSFT

Reputation: 2883

This is a doc error and we will fix it. The equivalent request (see below) is supported today in Microsoft Graph.

GET https://graph.microsoft.com/beta/users('{user_id}')/photos('{size}')/$value

Upvotes: 5

Related Questions