Google calendar api 使用Google日历API创建事件,但我的Google日历中没有显示任何内容

Google calendar api 使用Google日历API创建事件,但我的Google日历中没有显示任何内容,google-calendar-api,Google Calendar Api,我正在使用此代码将事件添加到日历中: <?php set_include_path( get_include_path() . PATH_SEPARATOR . 'lib/google-api-php-client-master/src' ); require_once 'lib/google-api-php-client-master/src/Google/Client.php'; require_once 'lib/google-api-php-client-master/src/Go

我正在使用此代码将事件添加到日历中:

<?php
set_include_path( get_include_path() . PATH_SEPARATOR . 'lib/google-api-php-client-master/src' );
require_once 'lib/google-api-php-client-master/src/Google/Client.php';
require_once 'lib/google-api-php-client-master/src/Google/Service/Calendar.php';
$client = new Google_Client();
$client->setApplicationName("Calendar");
$scopes = array('https://www.googleapis.com/auth/prediction', 'https://www.googleapis.com/auth/calendar');
$service_account_name='xxxx@developer.gserviceaccount.com';
$key_file_location='lib/myKey.p12';
$key = file_get_contents($key_file_location);
$auth_credentials = new Google_Auth_AssertionCredentials($service_account_name, $scopes, $key);
$client->setAssertionCredentials($auth_credentials);
$client->setClientId('xxxx.apps.googleusercontent.com');
$service = new Google_Service_Calendar($client);

try { 

$event = new Google_Service_Calendar_Event();
$event->setSummary('Halloween');
$event->setLocation('The Neighbourhood');
$event->setDescription('rien');
$start = new Google_Service_Calendar_EventDateTime();
$start->setDateTime('2014-04-02T10:00:00.000-07:00');
$event->setStart($start);
$end = new Google_Service_Calendar_EventDateTime();
$end->setDateTime('2014-04-03T10:25:00.000-07:00');
$event->setEnd($end);




$createdEvent = $service->events->insert('primary', $event);

echo $createdEvent->getId();
}
catch (Exception $ex)
{
    die($ex->getMessage());
}
?>


我得到了事件ID,它被打印出来,但当我在浏览器中查看日历时,完全没有任何内容。

它正在服务帐户的日历中创建事件,请检查我的答案