我正在尝试使用Google API的v3从客户的公共日历中获取事件列表.我将日历ID输入API Explorer,我得到了一个积极的结果:
https://www.googleapis.com/calendar/v3/calendars/rpsj44u6koirtq5hehkt21qs6k%40group.calendar.google.com/events?key={YOUR_API_KEY}`
=> [List of events here, as expected]
Run Code Online (Sandbox Code Playgroud)
为了创建API密钥,我在Google Developer Console中创建了一个项目,创建了一个公共API访问密钥(API&auth> Credentials),并{YOUR_API_KEY}在上面替换为我的实际密钥.我确保打开了Calendar API(API和auth> API).当我在浏览器中粘贴此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" …Run Code Online (Sandbox Code Playgroud)