3

Today I started to get this error upon adding new events 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

It worked perfectly till now and I didn't change anything in code.

o_O
  • 516
  • 2
  • 8
  • 25

4 Answers4

8

I had a similar problem accessing Google Analytics data with PHP. I fixed it by making sure the Analytics service was turned on for my project in my API console: https://code.google.com/apis/console/.

You may have to turn on the calendar service. See the link below for further explanation when someone had an issue with the translation service:

Translation api has stopped working

jk.
  • 14,365
  • 4
  • 43
  • 58
3

Don't know if this will help someone. I had the same error and I had tried everything. Then I removed "developer_key" from config.php and it worked. Please note I was using Service Account https://developers.google.com/accounts/docs/OAuth2ServiceAccount

gX.
  • 922
  • 1
  • 11
  • 18
  • Thank you! Been searching for the problem all day. I'm using calendar API via PHP client. This code used to work but at some point stopped, commenting out `$client->setDeveloperKey('...')` was the ticket – Dustin Butler Feb 28 '13 at 21:44
2

Well, they released new version and that what apparently caused errors. Got the newest version now and it works great once again.

o_O
  • 516
  • 2
  • 8
  • 25
0

Don't know if this will help someone, either.

It may also help to go to the respective calendar-settings page in your Google Account, edit something trivial and explicitly save again, (or re-save once more to set back to the old settings). Sometimes the google servers are a bit hesitant to accept any new settings, especially the "Sharing " settings. Check which of your service accounts have permission levels "can edit" , or "is owner" .

knb
  • 9,138
  • 4
  • 58
  • 85