我有这个 Google Scripts 脚本:
function moveHangoutLinks() {
var calendarId = '[email protected]';
var now = new Date();
var events = Calendar.Events.list(calendarId, {
timeMin: now.toISOString(),
singleEvents: true,
orderBy: 'startTime',
maxResults: 10
});
if (events.items && events.items.length > 0) {
for (var i = 0; i < events.items.length; i++) {
var event = events.items[i];
var d = event.description;
if (!d)
d = '';
if (event.googleDocsLink && (d.indexOf('Hangout: ') == -1)) {
// Logger.log (event.summary + ' - ' + event.hangoutLink + ' - ' + event.description);
event.description = 'Hangout: ' + event.hangoutLink + '\n\n' + d;
Calendar.Events.update(event, calendarId, event.id);
}
}
} else {
Logger.log('No events found.');
}
}
它基本上采用 Google 日历上每个事件的环聊链接,并将其放入事件描述中。
我想对任何 Google Docs 附件执行同样的操作,但我找不到任何文档来了解event
对象内的哪些属性可用。
我该怎么做/在哪里可以找到文档?
尝试事件:列表。
一个成功的 HTTP 请求,
GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events
将在响应正文中返回具有以下结构的事件资源:
{
"kind": "calendar#events",
"items": [
"attachments": [
{
"fileUrl": string,
"title": string,
"mimeType": string,
"iconLink": string,
"fileId": string
}
]
]
}
其中attachments[].fileUrl
是附件的 URL 链接。要添加 Google Drive 文件附件,请使用与alternateLink
Drive API 中文件资源的属性相同的格式。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句