Application Development

Hangouts Meet now available in the Google Calendar API

Thousands of developers use Google Calendar API to read, create and modify Google Calendar events, and quite often, these events represent meetings happening not just face-to-face but also remotely. We introduced Hangouts Meet earlier this year to give users richer conference experiences, adding video call links and phone numbers for G Suite Enterprise. Starting today, we are making it possible to access all that conference information through the Google Calendar API. With this update, developers can now:

  • Read conference data associated with events 
  • Copy conference data from one event to another 
  • Request new conference generation for an event 
The API supports all Hangouts versions.

Reading conference data 

Conference information is stored in a new event attribute called conferenceData.conferenceData provides information about the solution that was used to create the conference (such as Hangouts Meet) and a set of entry points (like a video call link and phone number). Everything the user needs to know to join a conference call is there.

To help you build even better user experiences, we also give you access to icons and user-readable labels that you can use in your products. In JSON format, conferenceData looks something like this (of course, your actual meeting IDs and phone numbers will vary):

  "conferenceData": {
  "entryPoints": [
   {
    "entryPointType": "video",
    "uri": "https://meet.google.com/wix-pvpt-njj",
    "label": "meet.google.com/wix-pvpt-njj"
   },
   {
    "entryPointType": "more",
    "uri": "https://tel.meet/wix-pvpt-njj?pin=1701789652855",
    "pin": "1701789652855"
   },
   {
    "entryPointType": "phone",
    "uri": "tel:+44-20-3873-7654",
    "label": "+44 20 3873 7654",
    "pin": "6054226"
   }
  ],
  "conferenceSolution": {
   "key": {
    "type": "hangoutsMeet"
   },
   "name": "Hangouts Meet",
   "iconUri": "https://lh5.googleusercontent.com/proxy/bWvYBOb7O03a7HK5iKNEAPoUNPEXH1CHZjuOkiqxHx8OtyVn9sZ6Ktl8hfqBNQUUbCDg6T2unnsHx7RSkCyhrKgHcdoosAW8POQJm_ZEvZU9ZfAE7mZIBGr_tDlF8Z_rSzXcjTffVXg3M46v"
  },
  "conferenceId": "wix-pvpt-njj",
  "signature": "ADwwud9tLfjGQPpT7bdP8f3bq3DS"
 }

And this, for example, is how you would retrieve and display conference solution name and icon:

  var solution = event.conferenceData.conferenceSolution;
var content = document.getElementById("content");
var text = document.createTextNode("Join " + solution.name);
var icon = document.createElement("img");
icon.src = solution.iconUri;
content.appendChild(icon);
content.appendChild(text);

The result of the code above will look like this in the user interface:

Screen%2BShot%2B2017-12-11%2Bat%2B483u3.PNG

Copying conferences across events 

Sometimes displaying information is not enough—you might want to update it as well. This is especially true when scheduling multiple Calendar events with the same conference details. Say you’re developing a recruiting application that sets up separate events for the candidate and the interviewer; you want to protect the interviewer’s identity, but you also want to make sure all participants join the same conference call. To do this, you can now copy conference information from one event to another by simply writing to conferenceData.

To ensure that only existing Hangouts conferences are copied, and to help safeguard your users against malicious actors, copied conference data will always be verified by the Google Calendar API using the signature field, so don’t forget to copy it too.

Creating a new conference for an event 

Finally, the API allows developers to request conference creation. Simply provide a conferenceData.createRequest and set the conferenceDataVersion request parameter to 1 when creating or updating events. Conferences are created asynchronously, but you can always check the status of your request to let your users know what’s happening. For example, to request conference generation for an existing event (again, your request and event IDs will be different):

  var eventPatch = {
  conferenceData: {
    createRequest: {requestId: "7qxalsvy0e"}
  }
};
gapi.client.calendar.events.patch({
  calendarId: "primary",
  eventId: "7cbh8rpc10lrc0ckih9tafss99",
  resource: eventPatch,
  sendNotifications: true,
  conferenceDataVersion: 1
}).execute(function(event) {
  console.log("Conference created for event: %s", event.htmlLink);
});

The immediate response to this call might not yet contain the fully-populated conferenceData which is indicated by status pending:

  "conferenceData": {
  "createRequest": {
   "requestId": "7qxalsvy0e",
   "conferenceSolutionKey": {
    "type": "hangoutsMeet"
   },
   "status": {
    "statusCode": "pending"
   }
  }
 }

Once the statusCode changes to success, the conference information is populated. Finally, if you are developing a Google Calendar client, you might also want to know beforehand which of the three Hangouts solutions (consumer Hangouts, classic Hangouts and Hangouts Meet) will be used to create the conference. You can get that information by checking allowedConferenceSolutionTypes in a calendar’s conferenceProperties.

To get started, check out the documentation page for managing conference data. We can’t wait to see what you build with these new features in the Google Calendar API.