I wrote the following function in Apps Script to create a Calendar Event (based on information in a Google Sheet), but would like one of the attendees to be the owner so they can see the waiting room for guests. Can I transfer ownership of the event or is there another way to make that happen?
function createEvent(title,start,end,teacher,student) {
// https://developers.google.com/apps-script/advanced/calendar
// https://developers.google.com/calendar/v3/reference/events
var event = {
summary: title,
description: 'Teacher / student meeting',
start: {
dateTime: start.toISOString()
},
end: {
dateTime: end.toISOString()
},
guestsCanInviteOthers: "no",
conferenceData: {
createRequest: {
conferenceSolutionKey: {
type: "hangoutsMeet"
},
requestId: start,
},
},
attendees: [
{email: teacher},
{email: student}
],
};
event = Calendar.Events.insert(event, calendarId, {sendNotifications: false, conferenceDataVersion: 1} );
return event.id;
}