Problem updating api v3 in google calendar

I am working on a Google calendar and have a problem synchronizing data between my Calendar application on Iphone in Google Calendar. (I use google api v3) The problem is that I can update the event by code only once after creation. The next time I try to update it, I get message code 400: bad request.

We can use Google Calendar to study to test this (https://code.google.com/apis/explorer/#_s=calendar&_v=v3&_m=calendars.update) by creating an event, then update it 2 times.

Does anyone help solve this problem?

+5
source share
3 answers

I had the same problem and got the answer here: Google Calendar API v3 - update event

You can edit the same event twice, you just need to “get” the sequence of events

$event = $service->events->get("primary", $exist); $seq=$event['sequence']; 

and use $event->setSequence($seq)

when configuring update event details.

+9
source

You cannot update the same event twice. Instead, create a second update request for new event data that is passed to the callback in the first update call (which has a new eTag) to update it a second time.

+3
source

Here is a sample Java code on how to update using a sequence:

 Event updatedEvent; Calendar Service; updatedEvent.setSequence(Service.events().get(mCalendarId, updatedEvent.getId()).execute().getSequence()); Service.events().update(mCalendarId, updatedEvent.getId(), updatedEvent).execute(); 
+1
source

All Articles