Php Google日历事件API抛出错误
我使用OAuth对我的应用程序进行了身份验证,并使用calendar API对其进行了测试。一切正常。我还为events API使用了“快速添加”方法,效果很好。但是当我尝试使用以下代码插入时Php Google日历事件API抛出错误,php,google-calendar-api,Php,Google Calendar Api,我使用OAuth对我的应用程序进行了身份验证,并使用calendar API对其进行了测试。一切正常。我还为events API使用了“快速添加”方法,效果很好。但是当我尝试使用以下代码插入时 $event = new Event(); $event->setSummary('hello there'); $event->setLocation('America/Los_Angeles'); $start = new EventDateTime(); $start->setDa
$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('myemail@gmail.com', $event);
我得到以下错误:
致命错误:未捕获的异常“apiServiceException”包含消息
'调用POST时出错: (400)中的“错误请求” C:\xampp\htdocs\uis\google-api-php-client\src\io\apiREST.php:86堆栈 跟踪:#0 C:\xampp\htdocs\uis\google-api-php-client\src\io\apiREST.php(56): apiREST::decodeHttpResponse(对象(apitpRequest))#1 C:\xampp\htdocs\uis\google-api-php-client\src\service\apiServiceResource.php(187): apiREST::execute(对象(apiServiceRequest))#2 C:\xampp\htdocs\uis\google-api-php-client\src\contrib\apiCalendarService.php(493): apiServiceResource->u调用('insert',Array)#3 C:\xampp\htdocs\uis\google api php客户端\examples\calendar\cal.php(44): EventsServiceResource->insert('paine1591@gmail...'对象(事件)4 {main}被抛出 C:\xampp\htdocs\uis\google api php客户端\src\io\apiREST.php联机 86 与myemail@gmail.com作为我日历的ID。它适用于其他一切
我做错了什么?您似乎没有设置活动的参与者 例如:
$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;