今天我在向日历添加新事件时开始出现此错误:
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控制台中为我的项目启用了Analytics服务来修复它:
https://code.google.com/apis/console/.