![Picture of Schenk Philipp Picture of Schenk Philipp](/graphics/unknown.gif)
Schenk Philipp - 2012-11-18 21:55:25 -
In reply to message 10 from Manuel Lemos
I have the line:
$ success = $ client-> CallAPI (
'https://www.googleapis.com/calendar/v3/calendars/me/event'
'GET', array (), array ('FailOnAccessError' => true), $ user);
and the code for the insert of the event:
Where do I insert the code?
It does not work:
/* API permissions */
$client->scope = 'https://www.googleapis.com/auth/calendar '.
'https://www.googleapis.com/auth/userinfo.profile';
if(($success = $client->Initialize()))
{
if(($success = $client->Process()))
{
if(strlen($client->authorization_error))
{
$client->error = $client->authorization_error;
$success = false;
}
elseif(strlen($client->access_token))
{
$success = $client->CallAPI(
'https://www.googleapis.com/calendar/v3/calendars/mymail@gmail.com/events',
'GET', array(), array('FailOnAccessError'=>true), $user);
$event = new Event();
$event->setSummary('Appointment');
$event->setLocation('Somewhere');
$start = new EventDateTime();
$start->setDateTime('2012-11-18T10:00:00');
$event->setStart($start);
$end = new EventDateTime();
$end->setDateTime('2012-12-18T10:30:00');
$event->setEnd($end);
$attendee1 = new EventAttendee();
$attendee1->setEmail('attendeeEmail');
// ...
$attendees = array($attendee1,
);
$event->attendees =
$attendees;
$createdEvent = $service->events->insert('primary', $event);
echo $createdEvent->getId();
}
}
$success = $client->Finalize($success);
}
if($client->exit)
exit;
if($success)
{
?>
Do you have an idea we could fumktionieren it?