1
我正在使用zendgdata庫的谷歌日曆。Gcal api投擲錯誤
我在使用此函數createQuickAddEvent(它將事件添加到Google日曆中)時出現此錯誤。
此功能的代碼是:
/**
* 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
可能這是因爲我還沒有第一次加載谷歌日曆(設置時區的事實當你點擊谷歌日曆)。加載谷歌日曆後,這個錯誤永遠不會來。但我想要一個解決方案this.This事情應該永遠不會發生與新用戶。
請幫我
謝謝。
感謝您的回覆,但我通過了clientobject,那麼爲什麼會發生這種情況,請您詳細說明我如何才能進行身份驗證? – 2009-09-09 07:12:16
是的,你正在傳遞一個客戶端對象 - 但它是否已通過身份驗證?請參閱http://framework.zend.com/manual/en/zend.gdata.authsub.html以獲取顯式authsub身份驗證。 – 2009-09-09 08:18:53
再次感謝我只是想確認用戶是否應該首先配置Google日曆,以便通過我的應用程序創建事件而不會出現任何錯誤。 – 2009-09-09 09:04:01