gpt4 book ai didi

api - 未配置 Google Calendar API v3 访问

转载 作者:行者123 更新时间:2023-12-03 13:25:42 24 4
gpt4 key购买 nike

我正在尝试使用 Google API 的 v3 从客户的公共(public)日历中获取事件列表。我在 API Explorer 中输入了日历 ID ,我得到了一个积极的结果:

https://www.googleapis.com/calendar/v3/calendars/rpsj44u6koirtq5hehkt21qs6k%40group.calendar.google.com/events?key={YOUR_API_KEY}`

=> [List of events here, as expected]

为了创建 API key ,我在 Google Developer Console 中创建了一个项目,创建了公共(public) API 访问 key ( APIs & auth > Credentials ),并替换了 {YOUR_API_KEY}上面是我的实际 key 。我确保日历 API 已打开( APIs & auth > APIs )。当我将此 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."
}
}

我看到的所有回复都说您需要确保 Google Calendar API 已打开,而且它肯定是打开的(此外,默认情况下它已打开)。我在这里想念什么?

最佳答案

您无需 OAuth 2.0 即可访问公共(public)日历。

我遇到了与首先描述的 sea_monster 相同的问题,虽然我插入了一个公共(public) API 访问 key 并检查了 API 是否已打开,但我总是收到一条错误消息:

403, AccessNotConfigured, The API is not enabled...



解决方案 :

我必须去谷歌开发者控制台,选择我的项目,点击左边的“APIs an Auth”,然后点击“APIs”并选择日历API。虽然它已打开,但我不得不停用 API,等待消息并再次打开 API。现在我的代码可以工作了,我不必更改它!

关于api - 未配置 Google Calendar API v3 访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26982523/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com