【问题标题】:Can't get events from public google calendar api v3无法从公共谷歌日历 api v3 获取事件
【发布时间】:2014-12-13 12:15:00
【问题描述】:

按照本教程http://www.androidhive.info/2012/01/android-json-parsing-tutorial,我已对其进行了调整,以使用此 URL“https://www.googleapis.com/calendar/v3/calendars/[calendar_ID]/events?singleEvents=true&orderBy=startTime&key=[my_API_key]”而不是示例中的 URL 来解析公共谷歌日历。此日历是公开的。

当我执行应用程序时,响应是这样的:

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.",
    "extendedHelp": "https://console.developers.google.com"
   }
  ],
  "code": 403,
  "message": "Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration."
 }
}

问题出在哪里?我做错了什么?

【问题讨论】:

  • 检查给定的api密钥是否有效,如果无效意味着您的api密钥在您的Gmail登录时已在Google api服务中注册。
  • 终于找到问题了,谢谢。我在答案中解释了。

标签: android google-api google-calendar-api


【解决方案1】:

我终于找到了解决办法。

在此 URL https://www.googleapis.com/calendar/v3/calendars/[calendar_ID]/events?singleEvents=true&orderBy=startTime&key=[my_API_key] 中,我使用的是 Android 应用程序的 API 密钥。当我将这个密钥更改为浏览器的 API 密钥时,问题就消失了。

【讨论】:

    猜你喜欢
    • 2013-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多