I'm trying to execute a simple freebusy query on the Google Calendar API. I have my authorization all working fine, can see lists of users' calendars, etc. When I try to submit a free/busy query, I get a 400 error with (as far as I can tell) not details at all about what it doesn't like.
This is true both in my own code and when I use the Google Calendar API "Try It" feature.
Here is my request (created using the Try It widget), and the response: Request
POST https://www.googleapis.com/calendar/v3/freeBusy?key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZTr-2wksEvp0iGPTnHTirTIItib5WwxmSAySq1ghfI98Cz88kA
X-JavaScript-User-Agent: Google APIs Explorer
{
"items": [
{
"id": "[my calendar id goes here]@group.calendar.google.com"
}
],
"timeMin": "2012-01-31T09:00:00",
"timeMax": "2012-01-31T10:00:00",
"timeZone": "GMT"
}
Response
400 Bad Request
cache-control: private, max-age=0
content-encoding: gzip
content-length: 122
content-type: application/json; charset=UTF-8
date: Sun, 16 Jun 2013 13:08:32 GMT
expires: Sun, 16 Jun 2013 13:08:32 GMT
server: GSE
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
I think it might have something to do with the dateTime objects/formatting? But I don't have any idea what. I'd really appreciate some help; I've been banging my head against this for a week!
"timeZone": "UTC"
or removing that attribute change anything? Is the API key in the URL being escaped properly? see: stackoverflow.com/questions/15926676/… – John Sheehan