I have delegated application admin access to ReadWrite all user calendars. I'm using the Graph API (beta). Resources are created in Office365 for meeting rooms.
I'm trying to change the end-time of an event that is in progress (e.g. the meeting ends early) using PATCH /users/{id}/events/{id}
Approach 1: Patching the event in the resource mailbox's calendar
Updating the start or end time of an event of a resource mailbox does not propagate to the calendars of attendees of that event. The resource mailbox's calendar is updated, but the event remains unchanged for all attendees.
E.g. for resource mailbox [email protected]
with an existing meeting with ID 12345
. Assume the meeting has start time of today 16:30 and end time of 17:00 UTC. Assume the current time is 16:50 UTC.
$microsoftEvent = json_encode([
'end' => [
'dateTime' => '2017-12-13T16:50:00.0000000',
'timeZone' => 'UTC'
]
], JSON_UNESCAPED_SLASHES);
$returnedEvent = $graph->createRequest("patch", "/users/[email protected]/events/12345")
->attachBody($microsoftEvent)
->setReturnType(\Microsoft\Graph\Model\Event::class)
->execute();
Approach 2: Patching the event in the organizer's calendar
Assume for the meeting above that the organizer is [email protected]
, and that the event ID in this user's calendar was obtained via the iCalUId
in a separate GET with a $filter
, and was found to be 56789
.
$microsoftEvent = json_encode([
'end' => [
'dateTime' => '2017-12-13T16:50:00.0000000',
'timeZone' => 'UTC'
]
], JSON_UNESCAPED_SLASHES);
$returnedEvent = $graph->createRequest("patch", "/users/[email protected]/events/56789")
->attachBody($microsoftEvent)
->setReturnType(\Microsoft\Graph\Model\Event::class)
->execute();
In this case, the organizer's event is updated, but the resource mailbox replies with
Your meeting request was declined. The invitation was declined because it occurred in the past.
Any advice would be appreciated.
Your meeting request was declined. The invitation was declined because it occurred in the past.
– karel