How do I use Google Apps Script to create a Google Calendar event with Hangouts Meet video call attached?

半世苍凉 提交于 2020-05-17 04:39:07

问题


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.

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.

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


回答1:


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});
}


来源:https://stackoverflow.com/questions/50892845/how-do-i-use-google-apps-script-to-create-a-google-calendar-event-with-hangouts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!