Search code examples
pythongoogle-app-enginegoogle-calendar-apigoogle-api-clientgoogle-api-python-client

403 Forbidden with endTimeUnspecified on Google calendar API?


It seems that the Google calendar API doesn't support to insert events (service.events().insert(calendarId='primary', body=ev)) with endTimeUnspecified (aka all-day event), at least with the google-api-python-client library.

My code works without fuss with a start-end event but returns 403 forbidden with all-day event.

I spent over two weeks looking into this, first asking here and lately reporting the problem as an issue on google-api-python-client GitHub tracker.

As suggested by Jon Parrot on GitHub, i beg the question to google-calendar-api guys:

  • is this behaviour a bug or a feature of google-calendar-api, or my code (see above links) is simply broken in a way i don't understand?
  • is it possible to programmatically add an all-day event from python appengine?

Solution

  • All day events must have the end time specified. As end is exclusive, an all day event for today would have the start 20170122 and the end 20170123. The endTimeUnspecified property is read only.