php - Google 日历 API - (403) 访问未配置'

标签 php google-api google-calendar-api

我开发了一个使用 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 之间同步一些东西,对吗?

有什么想法吗?

最佳答案

我不得不评论这一行:

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

然后它起作用了。

关于php - Google 日历 API - (403) 访问未配置',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16173295/

相关文章:

android - 如何帮助用户在 Android 设备上订阅外部日历到 Google 日历?

python - 使用 Python 访问 Google Calendar API

php - 在集群文件上使用 file_get_contents 是否安全?

javascript - 如何通过单击按钮创建表单加载项?

php - Google Calendar API服务帐户错误

c# - 通过 c# .net 使用 gmail 帐户登录

php - Google Plus API - 无法在特定日期之前处理 token

php - 使用 cURL 的 session

php - 使用SQLi数据库从表单插入数据

google-api - 如何向域的所有用户添加 Google 日历?