PHP Microsoft Graph - how to update an event

Carl Ogden 121 Reputation points
2021-10-12T07:29:21.927+00:00

Hi

I have the following code to create an event:-

                        $newEvent = [
                            'subject'                    => $event_subject,
                            'isReminderOn'               => $isReminderOn,
                            'reminderMinutesBeforeStart' => $reminderMinutesBeforeStart,
                            'isAllDay'                   => $isAllDay,
                            'showAs'                     => $showAs,
                            'sensitivity'                => $sensitivity,
                            'body'                       => [
                                'content' => $notes,
                                'contentType' => 'text'
                            ],
                            'start' => [
                                'dateTime' => $app_start_date,
                                'timeZone' => $viewData['userTimeZone']
                            ],
                            'end' => [
                                'dateTime' => $app_end_date,
                                'timeZone' => $viewData['userTimeZone']
                            ],
                            'attendees'     => $attendees,
                            'transactionId' => $appointment_id,
                        ];

$response = $graph->createRequest('POST', '/me/events')
                        ->attachBody($newEvent)
                        ->setReturnType(Model\Event::class)
                        ->execute();

I mark the created event with our internal transactionId.

How do I then update this event with either a change of date/time/subject/notes?

I've been unable to find example code to help me solve this issue.

Kind regards in advance
Carl.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,519 questions
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 36,736 Reputation points
    2021-10-14T09:56:24.443+00:00

    I am not familiar with PHP. As far as I know, Microsoft does not provide a PHP sample of the update event. However, code snippets in other languages are provided. You can refer to these code snippets to use PHP update events, their logic is the same.

    Microsoft Graph SDK for PHP.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    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.

    0 comments No comments