Could you please confirmed me if this example can work, because i tested and it's not working ...?
insert_events(id, json[1]);
insert_events(id, json[2]);
insert_events(id, json[3]);
insert_events(id, json[4]);
insert_events(id, json[5]);
insert_events(id, json[6]);
insert_events(id, json[7]);
insert_events(id, json[8]);
var insert_events = function insert_events(id, ressource){
var xhr = new XMLHttpRequest();
xhr.open('POST', '
https://www.googleapis.com/calendar/v3/calendars/'+id+'/events');
xhr.setRequestHeader('Authorization', 'Bearer ' + CookieToken);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.encode(ressource));
}
var myQueue = new Request.Queue({
requests: insert_events,
onComplete: function(name, instance, text, xml){
console.log('queue: ' + name + ' response: ', text, xml);
}
});