I created a project and registered it using https://code.google.com/apis/console (I chose a "different" type of application). Then I got a "Client ID" for installed applications.
Then I went to the console and created an event and allowed to use oauth 2. https://developers.google.com/google-apps/calendar/v3/reference/events/insert Everything worked fine.
POST https://www.googleapis.com/calendar/v3/calendars/primary/events?key={YOUR_API_KEY} Content-Type: application/json Authorization: xxx X-JavaScript-User-Agent: Google APIs Explorer { "end": { "dateTime": "2013-1-16T10:00:00.000-07:00" }, "start": { "dateTime": "2013-1-16T10:00:00.000-07:00" } }
Answer
200 OK - Show headers - { "kind": "calendar#event", "etag": "\"WANTVF5ixxZ04U_VtQ0AZ3MbAlM/Z2NhbDAwMDAxMzY1NjU0MzAwNTk1MDAw\"", "id": "2nsuis19mkp2q0uef54tl5nk68", "status": "confirmed", "htmlLink": "https://www.google.com/calendar/event?eid=Mm5zdWlzMTlta3AycTB1ZWY1NHRsNW5rNjggaXZhbjEzMzEzM0Bt", "created": "2013-04-11T04:25:00.000Z", "updated": "2013-04-11T04:25:00.595Z", "creator": { "email": " ivan133133@gmail.com ", "displayName": "ivan rozhcov", "self": true }, "organizer": { "email": " ivan133133@gmail.com ", "self": true }, "start": { "dateTime": "2013-01-16T21:00:00+04:00" }, "end": { "dateTime": "2013-01-16T21:00:00+04:00" }, "iCalUID": " 2nsuis19mkp2q0uef54tl5nk68@google.com ", "sequence": 0, "reminders": { "useDefault": true } }
Then I copied the id and updated this event. https://developers.google.com/google-apps/calendar/v3/reference/events/update update The first time I got a 200 response.
PUT https://www.googleapis.com/calendar/v3/calendars/primary/events/2nsuis19mkp2q0uef54tl5nk68?key={YOUR_API_KEY} Content-Type: application/json Authorization: Bearer ya29.AHES6ZRmo6pdxj8pY4NmzdI1estRNB-v87XV7xQHgyhrWHk2rzs3Ke8 X-JavaScript-User-Agent: Google APIs Explorer { "end": { "dateTime": "2013-1-16T10:00:00.000-07:00" }, "start": { "dateTime": "2013-1-16T10:00:00.000-07:00" } }
But when I tried it again, I always had 400 errors, the error text is written below.
https://developers.google.com/google-apps/calendar/v3/reference/events/update update
400 Bad Request cache-control: private, max-age=0 content-encoding: gzip content-length: 123 content-type: application/json; charset=UTF-8 date: Wed, 10 Apr 2013 12:49:29 GMT expires: Wed, 10 Apr 2013 12:49:29 GMT server: GSE { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid Value" } ], "code": 400, "message": "Invalid Value" } }
Can someone explain if this is google.api error, or maybe I'm wrong somewhere?
I tried it with differret account and PC (via Google API Explorer and python library with the same result)
Today I tried to reproduce this error. But now everything is working fine. I created a problem in google code http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3371&thanks=3371&ts=1365599378 Still unanswered.
I think it was a mistake of the time.