After creating a JSON object with event details, I attempted to add it to Google Calendar using the provided code snippet:
function addEvent() {
gapi.client.load('calendar', 'v3', function() {
var request = gapi.client.calendar.events.insert({
'calendarId': calendarId,
'resource': resource
});
request.execute(function(resp) {
console.log(resp);
});
});
}
Upon submitting the event, reminders were set for 5 minutes before via Popup and Email. Now, I am looking for a way to remove these reminders programmatically through the API.
Efforts Made So Far:
Attempt 1:
Following official documentation guidelines stated on this link, I tried setting reminders.useDefault
back to true
. However, this resulted in an error:
Cannot specify both default reminders and overrides at the same time.
Attempt 2:
Based on suggestions from a StackOverflow post (link here), I set "useDefault": false
without any overrides in the code. Unfortunately, this did not remove the reminders as expected.
Attempt 3:
In another trial, I completely removed the reminders section from the JSON object but faced similar results to Attempt 2.
If you have insights or suggestions on how to successfully remove the event reminder, your input would be highly appreciated.