我试图从谷歌应用程序脚本更新日历事件。我有日历ID、事件ID和试图作为变量更新的对象:
var eventinfo = {
"calendarId": calID
"eventId": eventID,
"resource": {
"description": "1234"
}
};
//update the event description and location
var updater;
try {
updater = Calendar.Events.update(eventinfo);
Logger.log('Successfully updated event: ' + i);
} catch (e) {
Logger.log('Fetch threw an exception: ' + e);
} 我得到了这个错误:
Fetch抛出一个异常:异常:提供的参数数无效。预期3-5
在此之前,我曾尝试以.update(calID, eventID, eventinfo)的方式调用update方法,其中事件信息是一个仅具有描述的对象,但返回的错误是错误调用。
我想我在我的目标论点中遗漏了一些东西。
发布于 2020-09-03 17:56:51
问题:
eventinfo定义中忘记了一个逗号。event object函数中传递一个Calendar.Events.update()。结构应该是这样的:
Calendar.Events.update(事件,calendarId,event.id );解决方案/实例:
当然,不要忘记从Resources => Advanced 上打开Calendar API。
参考文献:
https://stackoverflow.com/questions/63727358
复制相似问题