question

JanraluekJirayu-1144 avatar image
0 Votes"
JanraluekJirayu-1144 asked Amit-2358 published

Get photos of multiple users in MS Graph

From I've read the doc and MS Graph explorer, I realize that It has only a user per request to get the photo. So, How can I get photos of multiple users?
Eg. I wanna get photos size 48x48 of Adam, Eve, and Ashley in a single request.

microsoft-graph-users
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PraseethT-0176 avatar image
1 Vote"
PraseethT-0176 answered Amit-2358 published

It's possible to get photos of multiple users via Batch API https://docs.microsoft.com/en-us/graph/json-batching?context=graph%2Fapi%2F1.0&view=graph-rest-1.0

For E.g: POST https://graph.microsoft.com/v1.0/$batch
Request Body:
{
"requests": [
{
"url": "/users/abc@example.com/photos/48x48/$value",
"method": "GET",
"id": "1"
},
{
"url": "/users/xyz@example.com/photos/48x48/$value",
"method": "GET",
"id": "2"
}
]
}

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

good Its working for me

0 Votes 0 ·
CarlZhao-MSFT avatar image
1 Vote"
CarlZhao-MSFT answered

As far as I know, it is currently not supported to obtain photos of multiple users in a single request. You can only obtain photos of one user.


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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.