2012-04-19 19 views
0

私のアプリケーションはOAuthを使用して認証されています。カレンダーAPIでテストしました。すべてが機能します。また、イベントAPIに「クイック追加」メソッドを使用しましたが、うまくいきました。 [email protected]は私のカレンダーのIDであることをGoogleカレンダーのイベントAPIのスローエラー

Fatal error: Uncaught exception 'apiServiceException' with message 'Error calling POST
https://www.googleapis.com/calendar/v3/calendars/[email protected]/events?key=AIzaSyBddYIgnZJrXHuT8gvX-0tEypxsycw99rA : (400) Bad Request' in C:\xampp\htdocs\uis\google-api-php-client\src\io\apiREST.php:86 Stack trace: #0 C:\xampp\htdocs\uis\google-api-php-client\src\io\apiREST.php(56): apiREST::decodeHttpResponse(Object(apiHttpRequest)) #1 C:\xampp\htdocs\uis\google-api-php-client\src\service\apiServiceResource.php(187): apiREST::execute(Object(apiServiceRequest)) #2 C:\xampp\htdocs\uis\google-api-php-client\src\contrib\apiCalendarService.php(493): apiServiceResource->__call('insert', Array) #3 C:\xampp\htdocs\uis\google-api-php-client\examples\calendar\cal.php(44): EventsServiceResource->insert('[email protected]', Object(Event)) #4 {main} thrown in C:\xampp\htdocs\uis\google-api-php-client\src\io\apiREST.php on line 86

:私は次のコード

$event = new Event(); 
$event->setSummary('hello there'); 
$event->setLocation('America/Los_Angeles'); 
$start = new EventDateTime(); 
$start->setDateTime('2012-04-19'); 
$event->setStart($start); 
$createdEvent = $cal->events->insert('[email protected]', $event); 

を使用して挿入しようとしたとき、私は次のエラーを取得します。それは他のすべてのために働く。

私は間違っていますか?

答えて

1

イベントの出席者を設定していないようです。

例:

$end = new EventDateTime(); 
$end->setDateTime('2011-06-03T10:25:00.000-07:00'); 
$event->end = $end; 

$attendee1 = new EventAttendee(); 
$attendee1->email = 'attendeeEmail'; 

$attendees = array($attendee1, ...); 
$event->attendees = $attendees; 
関連する問題