有没有一种方法可以使用Google Apps脚本从Google日历获取视频通话链接? [英] is there a way to get video call link from google calendar with google apps script?

查看:84
本文介绍了有没有一种方法可以使用Google Apps脚本从Google日历获取视频通话链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用Google Apps服务和日历API的Google脚本.有没有办法从CalendarEvent对象获取视频通话ID?

I'm developing google script that uses google apps services and calendar api. Is there a way to get the video call id from CalendarEvent object?

推荐答案

使用默认的高级日历服务(您应该在脚本编辑器中通过选择资源">高级Google服务..."来启用它,然后在Google Developers Console中启用它).然后,您可以获取

This isn't possible using the default CalendarApp Service, you will need to use the Advanced Calendar Service (which you should enable in the Script Editor by selecting Resources > Advanced Google services... and then enable it in the Google Developers Console.) then you can get the hangoutLink of an event.

这是一个例子:

function myFunction() {
  var calendarId = 'calendarId';
  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];
      Logger.log('%s (%s)', event.summary, event.hangoutLink);
    }
  } else {
    Logger.log('No events found.');
  }
}

这篇关于有没有一种方法可以使用Google Apps脚本从Google日历获取视频通话链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆