Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 362
Ryan Ogden Avatar asked Aug 31 '25 21:08

Ryan Ogden


1 Answers

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});
}
like image 75
Ryan Ogden Avatar answered Sep 05 '25 05:09

Ryan Ogden