【问题标题】:Getting "Forbidden Error 403" on Google Calendar(s) using Zend_Gdata_Calendar()使用 Zend_Gdata_Calendar() 在 Google 日历上获取“禁止错误 403”
【发布时间】:2014-11-21 14:48:10
【问题描述】:

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

昨天(可能是前一天)脚本开始抛出错误Forbidden Error 403

这是脚本的 sn-p:

$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;

}

捕获结果显示以下错误消息{}:

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) 继续研究。

【问题讨论】:

    标签: zend-framework google-calendar-api


    【解决方案1】:

    自 11 月 17 日起,您将无法再使用 google API V1 或 API V2。 Zend Gdata 使用 google API V2。因此,您不能再使用 zend 来获取事件。您必须使用谷歌图书馆或使用您自己的课程。你可以看一个没有google library的google api V3类的例子:Authentification Zend Gdata (403 forbidden)

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-17
    • 1970-01-01
    • 2018-01-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多