Multiple users in a single graph call

Christopher R 20 Reputation points
2024-07-16T21:02:50.5233333+00:00

Hello. In my application, I received a list of users in my organization, and when I parse through the list in my code, I loop through each user and call the graph api calendarView to receive their events(in a 3 month range) and place it onto a third party scheduler feature. By looping through the list and calling the graph api for each one, it can be a long process. In a testing phase of just 4 users, it roughly takes about 16-24 seconds to get the events. In production, it might go up to 30 users.

When I use the graph api calendarView call, is it possible to call the entire list of users in one call, or I have to use the graph api call for each individual user?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,122 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 42,051 Reputation points
    2024-07-17T03:03:05.49+00:00

    Hi @Christopher R

    You must call the /calendarView endpoint once for each user because it does not support expansion of the user list. If you want to combine multiple requests into a single API call, you can try using JSON batching of the Graph API.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.