google-calendar-apigoogle-workspacegoogle-meet

Create Conference does not work in Google Calendar API


I am trying to create a meeting in Google Calendar via API that also generates a Google Hangouts Conference link.

There are many similar questions related to Creating Conference in Google Calendar Event API, but all of them are specific to SDKs in various languages.

So lets talk about raw REST using cURL.

Here is the sample request payload following the API documentation (to the extent it exists)

URL

https://www.googleapis.com/calendar/v3/calendars/c_188col86si730g45hheg1q66uia24@resource.calendar.google.com/events

Headers

Content-type: application/json, Authorization : Bearer xfgkhfkg

Body

    {
    "summary": "Test Conference creation",
    "start": {
        "dateTime": "2024-10-15T14:30:00Z",
        "timeZone": "UTC"
    },
    "end": {
        "dateTime": "2024-10-15T15:00:00Z",
        "timeZone": "UTC"
    },
    "conferenceData": {
        "createRequest": {
            "conferenceSolutionKey": {
                "type": "hangoutsMeet"
            },
            "requestId": "gdr-vcxn-pxe"
        }
    }
}

In response to this the meeting is created OK and the response payload does not contain any information about the conference, not even the status of the create request. Basically a silent failure

    {
    "kind": "calendar#event",
    "etag": "\"3457970518900000\"",
    "id": "2e6125e1hbl0rpecurs7b8q2t8",
    "status": "confirmed",
    "htmlLink": "https://www.google.com/calendar/event?eid=MmU2MTI1ZTFoYmwwcnBlY3VyczdiOHEydDggY18xODhjb2w4NnNpNzMwZzQ1aGhlZzFxNjZ1aWEyNEByZXNvdXJjZS5jYWxlbmRhci5nb29nbGUuY29t",
    "created": "2024-10-15T09:40:59.000Z",
    "updated": "2024-10-15T09:40:59.450Z",
    "summary": "Test Conference creation",
    "creator": {
        "email": "***-delegate-dev@***-test.com"
    },
    "organizer": {
        "email": "c_188col86si730g45hheg1q66uia24@resource.calendar.google.com",
        "displayName": "Building for Development-19-18-Dev Room 3 (6)",
        "self": true
    },
    "start": {
        "dateTime": "2024-10-15T20:00:00+05:30",
        "timeZone": "UTC"
    },
    "end": {
        "dateTime": "2024-10-15T20:30:00+05:30",
        "timeZone": "UTC"
    },
    "iCalUID": "2e6125e1hbl0rpecurs7b8q2t8@google.com",
    "sequence": 0,
    "reminders": {
        "useDefault": true
    },
    "eventType": "default"
}

What is the problem with the above payload? Is there something missing in the request?


Solution

  • Request parameters for adding Conference Data

    It seems that you are missing the conferenceDataVersion.

    There is an update regarding Google Calendar API release notes last September 07, 2020 that Meet video conferences should be added explicitly using the following existing parameters:

    1. Set conferenceDataVersion query parameter to 1.

    2. Set conferenceData.createRequest event property as follows:

      conferenceData.createRequest.conferenceSolutionKey.type to hangoutsMeet.
      
      conferenceData.createRequest.requestId to unique request id.
      

    Here is what I have used as endpoint.

    https://www.googleapis.com/calendar/v3/calendars/calID/events?conferenceDataVersion=1&key=[YOUR_API_KEY]
    

    Regarding your payload on the body I cannot seem to find any errors in it.

    Here is the complete Curl information I used to get a conference.

    curl --request POST \
      'https://www.googleapis.com/calendar/v3/calendars/[CALENDARID]/events?conferenceDataVersion=1&key=[YOUR_API_KEY]' \
      --header 'Authorization: [YOUR_ACCESS_TOKEN]' \
      --header 'Accept: application/json' \
      --header 'Content-Type: application/json' \
      --data '{"end":{"date":"2024-10-16"},"start":{"date":"2024-10-16"},"conferenceData":{"createRequest":{"requestId":"Always Regenerate","conferenceSolutionKey":{"type":"HangoutsMeet"}}}}' \
      --compressed
    

    Reference:

    Events

    Google Calendar API release notes