Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
403 views
in Technique[技术] by (71.8m points)

How can I create meeting with 3 persons using Google Calendar's API?

I am building a recruiting platform where an employer can book a meeting with a potential candidate. The owner of the website must be in this meeting.

So, basically, I would need to create a Google Meet with 3 invitations (us + 2 other people with email that are changing). Is there a way to achieve that using the Calendar API?

Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When creating Calendar Events with Google Meet using Events.insert method, you need to do the following:

  1. Set conferenceDataVersion parameter to 1

Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData.

  1. To create new conference details, use createRequest field of conferenceData. Set conferenceSolutionKey type to "hangoutsMeet" and set a random string for requestId in the request body.

Sample conferenceData:

"conferenceData": {
    "createRequest": {
      "conferenceSolutionKey": {
        "type": "hangoutsMeet"
      },
      "requestId": "7qxalsvy0exxaje"
    }
  }

If you want to send meeting invite to different people using Events.insert method, you need to do the following:

  1. Set sendUpdates parameter to "all" to send notifications to all the guests invited.

  2. Add event guests' using attendees properties in the request body.

Sample:

"attendees": [
    {
      "email": "[email protected]"
    },
    {
      "email": "[email protected]"
    }
  ],

Sample Events.insert parameters and request body:

enter image description here

{
  "end": {
    "dateTime": "2021-01-01T04:00:00+08:00"
  },
  "start": {
    "dateTime": "2021-01-01T03:00:00+08:00"
  },
  "attendees": [
    {
      "email": "[email protected]"
    },
    {
      "email": "[email protected]"
    }
  ],
  "conferenceData": {
    "createRequest": {
      "conferenceSolutionKey": {
        "type": "hangoutsMeet"
      },
      "requestId": "7qxalsvy0exxaje"
    }
  },
  "summary": "Sample Meeting"
}

Output:

enter image description here

References:

Create Events using Calendar API

Add video and phone conferences to events

Calendar API Reference


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.6k users

...