如何使用Google Apps脚本创建带有环聊会议视频通话的Google日历活动?

如何使用Google Apps脚本创建带有环聊会议视频通话的Google日历活动?

问题描述:

我正在寻找一个Google Apps脚本示例,其中创建了一个新的日历活动,并附加了环聊会议视频电话会议.供您参考,我在此处.我希望有一个示例可以帮助我理解脚本的外观,以便我可以出于自己的目的重制该脚本.

I am looking for an example of Google Apps Script in which a new calendar event is created with a Hangouts Meet video conference call attached. For your reference, the most relevant article that I've found to accomplish this is found here. I hope that an example will help me understand what the script should look like so that I can reproduce it for my own purposes.

为了避免造成误解,我想使用Google Apps脚本来完成手动创建新的日历事件时使用添加会议"功能时会完成的工作.

So that there's no misunderstanding, I want to accomplish with Google Apps Script what I would accomplish if I used the "Add conferencing" feature available when creating a new calendar event manually.

希望在附加视频通话的情况下,让与会者单击日历活动,并查看加入环聊聚会视频通话的选项.

With the video call attached, I hope for attendees to click on the calendar event and see the option to join the Hangouts Meet video call.

同样,我想使用Google Apps脚本完成此操作,主要是在寻找示例.

Again, I want to accomplish this using Google Apps Script and am looking primarily for an example.

找到了!这是我想要的代码.

Found it! This is the code I was looking for.

function newEvent() {
  var event = {
    "summary": 'Test',
    "end": {
      "dateTime": "2018-06-12T17:00:00-07:00"
    },
    "start": {
      "dateTime": "2018-06-12T09:00:00-07:00"
    },
    "conferenceData": {
      "createRequest": {
        "conferenceSolutionKey": {
          "type": "hangoutsMeet"
        },
        "requestId": "kdb-atdx-exx"
      }
    }
  };

  Calendar.Events.insert(event, 'primary', {
    "conferenceDataVersion": 1});
}