我正在为谷歌日历使用 zendgdata 库。
使用此函数 createQuickAddEvent 时出现此错误(它将事件添加到谷歌日历)。
这个函数的代码是:
/**
* Creates an event on the authenticated user's default calendar using
* the specified QuickAdd string.
*
* @param Zend_Http_Client $client The authenticated client object
* @param string $quickAddText The QuickAdd text for the event
* @return string The ID URL for the event
*/
function createQuickAddEvent ($client, $quickAddText) {
$gdataCal = new Zend_Gdata_Calendar($client);
$event = $gdataCal->newEventEntry();
$event->content = $gdataCal->newContent($quickAddText);
$event->quickAdd = $gdataCal->newQuickAdd(true);
$newEvent = $gdataCal->insertEvent($event);
return $newEvent->id->text;
}
错误:预期响应代码 200,得到 403
可能是因为我没有加载谷歌日历(第一次点击谷歌日历时设置时区)。加载谷歌日历后,这个错误永远不会出现。但我想要一个解决方案。这件事永远不会发生在新用户身上。
请帮我
谢谢。