【问题标题】:Google Calendar API - (403) Access Not Configured'Google Calendar API - (403) 访问未配置'
【发布时间】:2013-04-23 15:25:16
【问题描述】:

我开发了一个使用 Google Calendar API 的应用程序。

当我将它从我的开发环境转移到测试环境时,我在 Google API 控制台中为其创建了新条目,并将该信息复制到 config.php 中。

// The application_name is included in the User-Agent HTTP header.
'application_name' => 'Google Calendar PHP Starter Application',

// OAuth2 Settings, you can get these keys at https://code.google.com/apis/console
'oauth2_client_id' => '517034425134-503uog3i6pfXk15qq6mjsfbi48sabd50o.apps.googleusercontent.com',
'oauth2_client_secret' => '4p4go-aRXVcGx4YxcgC2wgvyV',
'oauth2_redirect_uri' => 'http://mydomain/admin/calendar_events.php',

// The developer key, you get this at https://code.google.com/apis/console
'developer_key' => 'AIzaSyCm9tj17rd-OepTl5XFxMwI9SQMH2BoQkKI',

但是,我无权访问。我得到:

Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/calendar/v3/users/me/calendarList?key=AIzaSyCm9tj17rd-OepTl5XFxMwI9SQMH2BoQkKI: (403) Access Not Configured'

我不确定这是为什么。我知道代码很好......我只需要在他们的 API 控制台和我的 config.php 之间同步一些东西,对吗?

有什么想法吗?

【问题讨论】:

    标签: php google-api google-calendar-api


    【解决方案1】:

    我不得不评论这一行:

    // 'developer_key' => 'AIzaSyCm9tj17rd-OepTl5XFxMwI9SQMH2BoQkKI',

    然后它起作用了。

    【讨论】:

    • 感谢它在 Blogger API 中也为我工作。但是你能说出这条线是干什么用的吗?
    【解决方案2】:

    打开服务后(在 Google Api 的“服务”选项卡下),我必须等待几分钟才能成功启动身份验证。

    【讨论】:

      【解决方案3】:

      您需要转到https://code.google.com/apis/console/ 并启用日历 API 的开关。

      这对我有用。

      【讨论】:

        【解决方案4】:

        您可以在“服务”选项卡中打开日历 API: http://screencast.com/t/DbfpznnOT

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2014-01-22
          • 2012-06-12
          • 2014-01-24
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-04-30
          • 1970-01-01
          相关资源
          最近更新 更多