(403)在向日历添加事件时未配置访问权限


(403) Access Not Configured when adding event to calendar

今天我开始得到这个错误添加新的事件到日历:

Fatal error: Uncaught exception 'apiServiceException' with message
 'Error calling POST https://www.googleapis.com/calendar/v3/
calendars/[cal-id]@group.calendar.google.com/events?alt=json&key=[dev-key]:
 (403) Access Not Configured' in /[...]/src/io/apiREST.php:86
 Stack trace: #0 /[...]/src/io/apiREST.php(56): apiREST::decodeHttpResponse(Object(apiHttpRequest)) 
 #1 /[...]/src/service/apiServiceResource.php(148): apiREST::execute(Object(apiServiceRequest)) #2 /[...]/src/contrib/apiCalendarService.php(472): 
apiServiceResource->__call('insert', Array) #3 /[...]/index.php(160): EventsServiceResource->insert('[cal-id-part]...', 
Object(Ev in /[...]/src/io/apiREST.php on line 86

到现在为止,它工作得很好,我没有改变任何代码。

我用PHP访问Google Analytics数据时遇到了类似的问题。我通过确保在我的API控制台中为我的项目打开分析服务来修复它:https://code.google.com/apis/console/.

您可能必须打开日历服务。当有人遇到翻译服务问题时,请参阅下面的链接以获得进一步的解释:

翻译api停止工作

不知道这是否会对某人有所帮助。我也犯了同样的错误,我什么都试过了。然后我从config.php中删除了"developer_key",它工作了。请注意,我使用的是服务帐户https://developers.google.com/accounts/docs/OAuth2ServiceAccount

嗯,他们发布了新版本,这显然引起了错误。现在有了最新的版本,它又好用了。

我也不知道这是否能帮到别人。

在你的Google帐户中去相应的日历设置页面,编辑一些琐碎的东西并明确地再次保存,(或者再次保存以设置回旧设置)也可能有所帮助。有时候google服务器会犹豫是否接受新的设置,尤其是"共享"设置。检查哪些服务帐户具有"可以编辑"或"是所有者"的权限级别。