Zend framework Gcal api抛出错误

Zend framework Gcal api抛出错误,zend-framework,google-calendar-api,gcal,Zend Framework,Google Calendar Api,Gcal,我正在使用谷歌日历的zendgdata库 我在使用这个函数createQuickAddEvent(它将事件添加到google日历)时遇到这个错误 此功能的代码为: /** * Creates an event on the authenticated user's default calendar using * the specified QuickAdd string. * * @param Zend_Http_Client $client The authenticated cl

我正在使用谷歌日历的zendgdata库

我在使用这个函数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

这可能是因为我没有加载谷歌日历(第一次单击谷歌日历时设置时区)。在加载谷歌日历后,这个错误永远不会出现。但我想解决这个问题。这件事不应该发生在新用户身上

请帮帮我


谢谢。

编辑:好吧,我想我完全误解了你

您的意思是要将事件添加到日历中,但日历甚至还不存在?不,你不能那样做。用户必须先注册谷歌日历,然后才能尝试使用它


除此之外,创建日历还需要用户同意服务条款和隐私政策。虽然我们可能有一些自动化的方法——可能是针对已验证的合作伙伴,我们会检查应用程序是否要求相同的同意——但我高度怀疑它是否可以通过Gdata获得。

感谢您的回复,但我正在传递clientobject,那么为什么会发生这种情况&您能否详细说明我如何明确地进行身份验证?是的,您正在传入一个客户端对象,但它是否已通过身份验证?请参阅以获取显式authsub身份验证。再次感谢。我只想确认用户是否应首先配置google calendar,以便通过我的应用程序创建事件而不出现任何错误。感谢您的回复,我得到了答案