Share via

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 Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

  1. CarlZhao-MSFT 46,456 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.

    Was this answer helpful?

    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.