Get photos of multiple users in MS Graph

Janraluek, Jirayu 66 Reputation points
2021-10-28T03:28:17.6+00:00

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
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,520 questions
0 comments No comments
{count} votes

Accepted answer
  1. Praseeth T 81 Reputation points
    2021-12-17T05:00:46.593+00:00

    It's possible to get photos of multiple users via Batch API https://learn.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@ssss .com/photos/48x48/$value",
    "method": "GET",
    "id": "1"
    },
    {
    "url": "/users/xyz@ssss .com/photos/48x48/$value",
    "method": "GET",
    "id": "2"
    }
    ]
    }

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. CarlZhao-MSFT 36,736 Reputation points
    2021-10-28T09:53:15.237+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments