背景:谷歌日历 > 点击新建按钮 > 进入新活动页面 > 添加会议
问题:当用户点击添加会议安排会议(第三方服务,不是环聊)时,如何获取当前活动的会议数据?我尝试使用Calendar.Events.get
API,但它返回 404。
我的 appscripts 设置在这里:
当用户安排会议时,它会触发
onCalendarEventUpdate
功能
{
"timeZone": "America/Los_Angeles",
"addOns": {
"calendar": {
"eventUpdateTrigger": {
"runFunction": "onCalendarEventUpdate"
},
}
}
}
我的onCalendarEventUpdate
:
function onCalendarEventUpdate(context: any) {
// I can get calendarId, evnetId
const {
calendar: { calendarId, id: evnetId }
} = context;
// when I try to get event conferenceData, it returns 404
let event;
try {
event = Calendar.Events && Calendar.Events.get(calendarId, evnetId);
if (!event) {
Logger.log(`[getEventsCollectionByCalendarId]event not found`);
}
} catch (e) {
Logger.log(`[getEventsCollectionByCalendarId]error: ${JSON.stringify(e)}`);
}
}
现在错误消息是:
{
"message":"API call to calendar.events.get failed with error: Not Found",
"name":"GoogleJsonResponseException",
"lineNumber":64,
"details":{
"message":"Not Found",
"code":404,
"errors":[{
"domain":"global",
"reason":"notFound",
"message":"Not Found"
}]
}
}