1

I have integrated my PHP application with Google Calendar using my service account.

The event creation through my application is working successfully.

I am trying to override the events reminder settings through the override method as follows.

 $event = new \Google_Service_Calendar_Event(array(
                'summary' => 'My App Appointment Reminders2',              
                'description' => 'My App Reminders',
                'start' => array(
                'dateTime' => $start['dateTime'],
                'timeZone' => $zone,
                ),
                'end' => array(
                'dateTime' => $end['dateTime'],
                'timeZone' => $zone,
                ),
                'attendees' => array(
                array('email' => 'example@gmail.com'),
                )
                ,
                'reminders' => array(
                'useDefault' => false
                 ,
                  'overrides' => array(
                  array('method' => 'email', 'minutes' => 15),
                  array('method' => 'popup', 'minutes' => 15),
                  ),
            ),
            ));

I have also used the string instead of boolean for Usedefault. Still it is not working

Please help me to resolve this. Thanks in advance...

1 Answers1

0

This issue has been reported on Google's Public Issue Tracker and is under investigation

The issue is related to using a service account when performing requests with the Calendar API. In the meantime, as a workaround:

  • Do NOT use a service account without impersonation
  • Instead, enable domain-wide delegeation and let the service account impersonate a domain user who has editor access to the calendar
  • In PHP you can perform impersonation with $client->setSubject('user to impersonate');
  • See here for samples
ziganotschka
  • 25,866
  • 2
  • 16
  • 33