PHP: Google_Service_Exception (404) When Requesting Events

586 views
Skip to first unread message

Rick Buczynski

unread,
May 20, 2014, 9:37:09 AM5/20/14
to google-ca...@googlegroups.com
I am making a call using a service account which has been authorized as a writer. I can retrieve calendars using the calendarList resource just fine. However, when I try to retrieve events I get this error:

Google_Service_Exception: Error calling GET https://www.googleapis.com/calendar/v3/calendars/calendarId,myemail%domain.com,maxResults,2500/events: (404) Not Found in /path/to/lib/Google/Http/REST.php on line 81

Is this a permissions problem?

I've also tried to supply a sub property for the requested account but I get the same error. Any help would be appreciated. Thanks!

Rick Buczynski

unread,
Jul 3, 2014, 2:02:57 PM7/3/14
to google-ca...@googlegroups.com
Found the problem. I was passing parameters to Google_Service_Calendar_Events_Resource::list incorrectly.

The nature of the error message sent me off in the wrong direction for a while. So you'll get a 404 if the parameter format on a resource is incorrect. I also discovered that you'll get a 404 when attempting to request events for a calendar to which your service account does not have permission.

It would be nice to see a detailed error message in the latter case. Hopefully this information is useful to someone.
Reply all
Reply to author
Forward
0 new messages