Closed GoogleCodeExporter closed 8 years ago
I think I wrote all essential paramaters (due to documentation), but still get
this error. Any way to find out which part of request is bad?
Original comment by saeed....@gmail.com
on 26 Jan 2012 at 6:51
Original comment by leont...@google.com
on 31 Jan 2012 at 7:45
I think the problem is that "id" key is specified in event body. I got bad
request if "id" is present in the body and event inserted successfully if "id"
was absent. API is supposed to generate "id" itself and return to the caller.
http://code.google.com/apis/calendar/v3/using.html#creating_events
I wasn't using apiKey= parameter though, only OAuth2 request.
Please try inserting the event without pre-defined "id"
service.colors().get().execute() returns 4xx error for me. Investigating.
Original comment by leont...@google.com
on 31 Jan 2012 at 8:44
I removed 'id' and still get Bad Request.
Original comment by saeed....@gmail.com
on 1 Feb 2012 at 6:12
body='{"status": "confirmed", "description": "", "sequence": 0, "visibility":
"default", "guestsCanModify": false, "calendarId":
"93mfmsvanup0tllng6tgpm1g88@group.calendar.google.com", "end": {"dateTime":
"20120123T120839"}, "organizer": {"displayName": "Saeed", "email": ""}, "kind":
"calendar#event", "attendees": [], "reminders": {"overrides": {"minutes": 0,
"method": "popup"}}, "summary": "task1", "start": {"dateTime":
"20120123T110839"}, "etag": "dyMyWqH6pm"}'
Original comment by saeed....@gmail.com
on 1 Feb 2012 at 6:13
(also filled email part)
Original comment by saeed....@gmail.com
on 1 Feb 2012 at 6:16
The following request works for me:
body = {
"kind": "calendar#event",
"description": "My test event",
"summary": "Test",
"start": {
"timeZone": "GMT",
"dateTime": "2012-01-31T09:00:00"
},
"end": {
"timeZone": "GMT",
"dateTime": "2012-01-31T10:00:00"
}
}
pprint.pprint(service.events().insert(
body=body,
calendarId='primary',
).execute())
Note the format of the dateTime.
Original comment by jcgregorio@google.com
on 1 Feb 2012 at 2:15
Thanks, solved.
I saw that time format all around ics files and I supposed that google calendar
also uses that format.
Original comment by saeed....@gmail.com
on 2 Feb 2012 at 9:05
Original comment by jcgregorio@google.com
on 23 Feb 2012 at 6:32
Original issue reported on code.google.com by
saeed....@gmail.com
on 23 Jan 2012 at 10:56