I am working with the google calendar api and i was wondering if it was possible to patch/update the responsestatus of an invitee. I am able to access the google calendar of the users and insert, delete and update their google calendar. But I do not know how I can change the responsestatus for an user.
This is my patchdate function where I am trying to patch an event.
function patchDate(calendarid, dateFormat) {
gapi.client.load('calendar', 'v3', function() { // load the calendar api (version 3)
var request = gapi.client.calendar.events.patch({
'calendarId': 'primary', // calendar ID
"eventId": calendarid, // pass event id
"sendNotifications": true,
"resource": dateFormat // pass event details with api call
});
// handle the response from our api call
request.execute(function(resp) {
if(resp.error || resp == false) {
console.log("failed to update")
} else {
console.log("successfully updated")
}
console.log(resp);
});
});
}
This is how I call my function. I am passing in the user email that I want to patch. There are multiple emailaddresses in the google calendar event but I only want to change one of them. In this case this would be the example@.com
var dateFormat = {
"email": 'example@.com',
"responseStatus": 'accepted'
};
patchDate(tableData[6], dateFormat)
I get a 200 ok response when I try patching an event but the responsestatus does not change.