So I've been using the REST method of invoking Google's API. I need to insert events into a particular calendar whose ID I have. This is the POST request I'm sending:
Address: https://www.googleapis.com/calendar/v3/calendars/{calendarID}/events
Body:
Authorization: Bearer {access_token} { "end": { "dateTime": "2012-08-30T12:30:00", "timeZone": "America/Chicago" }, "start": { "dateTime": "2012-08-30T14:00:00", "timeZone": "America/Chicago" }, "summary": "E E 306", "colorId": "9" "kind": "calendar#event" }
And this is the response I keep getting:
{ "error":{ "errors":[ { "domain":"calendar", "reason":"timeRangeEmpty", "message":"The specified time range is empty.", "locationType":"parameter", "location":"timeMax" } ], "code":400, "message":"The specified time range is empty." } }
I don't understand what I could possibly be doing wrong. I've entered all necessary data, and it's asking me for a parameter that doesn't even exist for events. I also can't find any documentation out there on this particular problem. Does anyone see something I'm missing?
In Gmail settings, turn on Smart features and personalization. Learn how to turn on Smart features and personalization in Gmail. In Google Calendar settings, go to Events from Gmail, and check the box next to Show events automatically created by Gmail in my calendar.
The Google Calendar API enables developers to add full calendar data and functionality into their app using a REST interface, or through one of the client libraries Google offers for languages like Java, Python, PHP, JavaScript, and more.
In the midst of asking this question, I face palmed so hard I think I've done myself brain damage. As it turns out, the reason I couldn't find any documentation on this problem was because of how spectacularly silly it was.
The reason it was giving me such a funny error was because in the copy-pasting I was doing to test, I flipped the start and end times. So, I was telling Google Calendars to enter an event that ended before it started, which generally doesn't end too well.
Long story short, if you get an error referring to the "timeMax" parameter while trying to insert an event, check your start and end times.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With