WAI
Status Update
Comments
jp...@google.com <jp...@google.com> #2
I have reported this to the engineering team and future updates will be shared here. Thank you for your patience.
jo...@google.com <jo...@google.com> #3
Hello,
The OAuth scopes you requested do not allow editing meeting spaces that have not been created by your app. In the case you provide, you appear to be attempting to edit a meeting space created by Google Calendar.
We do not offer an OAuth scope that allows editing meeting spaces created by other apps at this time; however, a workaround could be to replace the meeting space in the calendar event with one your app created, allowing you to edit the settings as needed.
The OAuth scopes you requested do not allow editing meeting spaces that have not been created by your app. In the case you provide, you appear to be attempting to edit a meeting space created by Google Calendar.
We do not offer an OAuth scope that allows editing meeting spaces created by other apps at this time; however, a workaround could be to replace the meeting space in the calendar event with one your app created, allowing you to edit the settings as needed.
m....@gmail.com <m....@gmail.com> #4
Thanks for the clarification. Confirming creating the meet space then adding to the calendar event works. Providing the sample code for others finding this ticket:
function createMeetingAddToEvent() {
// Create access type to "OPEN" using UrlFetchApp
const meetCreateUrl = `https://meet.googleapis.com/v2/spaces`;
const payload = {
"config": {
"access_type": "OPEN"
}
};
const requestOptions = {
method: "POST",
headers: {
"Authorization": `Bearer ${ScriptApp.getOAuthToken()}`,
},
"contentType": "application/json",
payload: JSON.stringify(payload),
};
const meetSpaceResponse = UrlFetchApp.fetch(meetCreateUrl, requestOptions);
const meetSpace = JSON.parse(meetSpaceResponse.getContentText());
console.log("Space updated: %s", JSON.stringify(meetSpace, null, 2));
// Create a calendar event with a Google Meet conference
const calendarId = "primary";
const date = new Date().toISOString().split("T")[0];
const event = Calendar.Events.insert({
summary: "test event",
description: "description",
start: { date: date },
end: { date: date },
hangoutLink: meetSpace.meetingUri,
conferenceData: {
conferenceId: meetSpace.meetingCode,
entryPoints: [
{
entryPointType: "video",
uri: meetSpace.meetingUri,
label: `meet.google.com/${meetSpace.meetingCode}`
}
],
conferenceSolution: {
key: {
type: "hangoutsMeet"
}
}
},
}, calendarId, { conferenceDataVersion: 1 });
console.log("Event created: %s", JSON.stringify(event, null, 2));
}
Description
Description
I've attempted to port the NodeJS code for updating the access settings for a Meet space published here to Google Apps Script.
The code is failing on the spaces.patch call with a 403 permission denied error.
In terms of setup the code below was added to a new Google Apps Script project. The Apps Script project was updated to use a standard GCP with the Calendar and Meet API enabled. The screenshot shows the scopes requested as part of the auth flow.
Code
Code.gs
appsscript.info
Output