0
Calendar.Events.move(sourceCalendarId, eventId, destinationCalendarId);

GoogleJsonResponseException: API call to calendar.events.move failed with error: Not Found

what should i do? when i move to this error it moves cursor here:

Calendar.Events`.`move(sourceCalendarId, eventId, destinationCalendarId);

why this error accured and how should i fix it?

DragonHunter
  • 9
  • 1
  • 4

1 Answers1

0

Try it this way:

The short answer is the id you are supplying is the wrong id.

function moveEvents() {
  const calid1 = 'fromid';
  const calid2 = 'toid';
  const eventTitle = "Title";
  var pageToken = null;
  do {
    var r = Calendar.Events.list(calid1, {q: eventTitle,pageToken: pageToken});
    r.items.filter(ev => ev.summary == eventTitle).forEach(ev => Calendar.Events.move(calid1, ev.id, calid2));
    pageToken = r.nextPageToken;
  } while (pageToken)
}

learn more

and even more

where my code came from

Cooper
  • 59,616
  • 6
  • 23
  • 54