Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php (403)将事件添加到日历时未配置访问权限_Php_Google Api_Google Calendar Api_Oauth 2.0 - Fatal编程技术网

Php (403)将事件添加到日历时未配置访问权限

Php (403)将事件添加到日历时未配置访问权限,php,google-api,google-calendar-api,oauth-2.0,Php,Google Api,Google Calendar Api,Oauth 2.0,今天,在向日历添加新事件时,我开始出现以下错误: 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

今天,在向日历添加新事件时,我开始出现以下错误:

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控制台中为我的项目打开了分析服务来修复它:

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


嗯,他们发布了新版本,这显然是导致错误的原因。现在获得了最新版本,它再次运行良好。

不知道这是否对某人有帮助。
我也犯了同样的错误,我什么都试过了。然后我从config.php中删除了“developer_key”,它就可以工作了。请注意,我使用的是服务帐户

也不知道这是否有帮助


它也可能有助于转到谷歌帐户中相应的日历设置页面,编辑一些琐碎的内容并再次显式保存(或者再次保存以设置回旧设置)。有时谷歌服务器在接受任何新设置时都会有点犹豫,尤其是“共享”设置。检查您的哪些服务帐户具有“可以编辑”或“是所有者”的权限级别。

谢谢!我整天都在寻找这个问题。我通过PHP客户端使用日历API。这段代码过去可以工作,但在某个时候停止了,注释掉
$client->setDeveloperKey(“…”)
就是问题所在