繁体   English   中英

使用Zend_Gdata_Calendar()在Google日历上获取“禁止错误403”

[英]Getting “Forbidden Error 403” on Google Calendar(s) using Zend_Gdata_Calendar()

我在一个网站的主页上运行着一个嵌入式脚本,该脚本可以在Google日历上提取选定的事件列表,并在页面上列出这些事件。 自2011年左右以来,我一直在运行此脚本,没有更改或修订。

昨天(也许是前一天),脚本开始引发错误Forbidden Error 403

这是脚本的片段:

$ctz = 'America/Los_Angeles';
$calendarID[] = 'example.com_abcdefghijklmnop1234567890@group.calendar.google.com'; //Dept 1 Events
$calendarID[] = 'example.com_klmnopqrstuvwxyz0987654321@group.calendar.google.com'; //Dept 2 Events
/*...*/
$eventArray = buildEventList($calendarID, $ctz);


function buildEventList($calendarID=NULL,$ctz=NULL) {

    require_once('Zend/Loader.php');
    Zend_Loader::loadClass('Zend_Gdata');
    Zend_Loader::loadClass('Zend_Gdata_Calendar');
    Zend_Loader::loadClass('Zend_Uri_Http');

    $gdataCal = new Zend_Gdata_Calendar();
    $query = $gdataCal->newEventQuery();

    try {
        /*...*/
    }

    catch (Zend_Gdata_App_Exception $e) {
        $return = $e->getMessage();
    }

    return $return;

}

由于catch {}而导致显示以下错误消息:

Expected response code 200, got 403
<HTML>
<HEAD>
<TITLE>Forbidden</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Forbidden</H1>
<H2>Error 403</H2>
</BODY>
</HTML>

关于为什么开始发生或如何解决的任何想法?

注意:我登录了每个Google日历,其设置均未更改。 它们仍然是公开共享的,并且ID并未更改-我已验证了Google帐户中的所有内容。

通过持续研究获得的经验:我认为我可能需要Google开发者密钥-(1)不确定如何获得它,以及(2)继续进行研究。

自11月17日起,您将无法再使用Google API V1或API V2。 Zend Gdata使用Google API V2。 因此,您不能再使用zend来获取事件。 您必须使用Google图书馆或使用自己的课程。 您可以看到不带Google库的Google api V3类的示例: 身份验证Zend Gdata(禁止403)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM