When you deal with good number of data in response (as i see that you're trying with max value), i would suggest you to use Microsoft Graph pagination to start with.
PHP SDK - Timeout while getting calendar events
When sending a request for events for the next 1825 days (max allowed) I get a timeout for 2 authorizations (out of maybe 80 in total). The timeout I get is from Guzzle/cURL
The code i use is the following:
$calendar_id is a valid UUID for a calendar.
$from and $to are DateTime objects.
$events = [];
$query = [
'startDateTime' => $from->format('c'),
'endDateTime' => $to->format('c'),
];
$response = $this->graph->createCollectionRequest('GET', '/me/calendars/'.$calendar_id.'/calendarView?'.http_build_query($query))
->setReturnType(Model\Event::class)
->addHeaders(['Prefer' => 'outlook.timezone="Europe/Copenhagen"'])
->setTimeout(20)
->setPageSize(20);
while(!$response->isEnd()){
$events = array_merge($events, $response->getPage());
}
return $events;
Microsoft Security Microsoft Graph
1 answer
Sort by: Most helpful
-
Deva-MSFT 2,271 Reputation points Microsoft Employee
2021-03-30T17:21:18.58+00:00