Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Calendar API drops "conferenceData" nested object

EDIT: This is has been identified as a bug here.

I am trying to make a Google Meet along with a new calendar event. However, for some reason the returning event does not include any conferenceData, not even one with status fail.

Here is my code. I have omitted the authentication step as I do not get an authentication error.

def generateMeet(emails=None, fake=False):
    if emails is None:
        emails = []

    if fake:
        return "https://www.google.com", get_random_string(10)

    now = datetime.utcnow().isoformat() + 'Z'  # 'Z' indicates UTC time
    inonehour = (datetime.utcnow() + timedelta(hours=1)).isoformat() + 'Z'

    event = {
        'summary': 'Orb Meeting',
        'start': {
            'dateTime': now,
            'timeZone': 'America/New_York',
        },
        'end': {
            'dateTime': inonehour,
            'timeZone': 'America/New_York',
        },
        'sendUpdates': "none",
        'reminders': {
            'useDefault': False,
        },
        'attendees': [{'email': x} for x in emails],
        'conferenceDataVersion': 1,
        'conferenceData': {
            'createRequest': {
                'requestID': get_random_string(10),
                'conferenceSolutionKey': {
                    'type': 'hangoutsMeet'
                },

            }
        }
    }

    ret = service.events().insert(calendarId='primary', body=event).execute()
    return ret['conferenceData']['entryPoints'], ret['id']

This returns a key error, as conference data does not exist. Here is the full 'ret' object before I run the return:

{'kind': 'calendar#event', 'etag': '"3197938620273000"', 'id': '5fb6epfe93sceba9scjt1nevsk', 'status': 'confirmed',
     'htmlLink': 'https://www.google.com/calendar/event?eid=NWZiNmVwZmU5M3NjZWJhOXNjanQxbmV2c2sgZm9ycmVzdG1pbG5lckBt',
     'created': '2020-09-01T14:08:30.000Z', 'updated': '2020-09-01T14:08:30.162Z', 'summary': 'Orb Meeting',
     'creator': {'email': '[my email]', 'self': True},
     'organizer': {'email': '[my email]', 'self': True},
     'start': {'dateTime': '2020-09-01T10:08:28-04:00', 'timeZone': 'America/New_York'},
     'end': {'dateTime': '2020-09-01T11:08:28-04:00', 'timeZone': 'America/New_York'},
     'iCalUID': '[email protected]', 'sequence': 0,
     'attendees': [{'email': '[my other email]', 'displayName': 'Forrest Milner', 'responseStatus': 'needsAction'}],
     'reminders': {'useDefault': False}}

Can anyone tell me why the conferenceData part of my request might be dropped? I am setting the conferenceDataVersion to 1, and using a random string.

I have tried adding dummy "invitees". In this trial, I invited my second gmail account, and in other trials I have invited several dummy accounts with domain "example.com". This updates the attendees, but does not make the conference data appear.

I have also tried waiting a few minutes and then listing all my events. Even after waiting, the conference data was not filled in. When I check my calendar on the GUI (https://calendar.google.com/calendar/r) it also does not have a Google Meet attached.

Thank you for any help.

like image 367
Forrest Milner Avatar asked Sep 01 '20 14:09

Forrest Milner


People also ask

Why do events keep disappearing from my Google Calendar?

You know that the cache in your device saves information from apps. The case is the same with Google Calendar app. Now when these cache files become corrupted, you may see your Google Calendar events disappear. That's because these corrupted files hamper smooth calendar events syncing.

How do I stop Google Calendar events from overlapping?

To avoid overlapping of two meetings or events, the simplest way to do is to not create two events where one's ending time is same as other's starting point. If your event starts at 10.30 and ends at 11.30, schedule it upto 11.29 and create the next event on 11.30.

How do I layer events in Google Calendar?

Hovering over a name and pressing the downward facing arrow that appears at the right will allow you to edit layering settings. This includes assigning another color, hiding the calendar, and even editing calendar settings.

Where can I find event resources in the calendar API?

The Calendar API provides different flavors of event resources, more information can be found in About events. For a list of methods for this resource, see the end of this page. Whether anyone can invite themselves to the event (deprecated).

What is the conferencedata version?

Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0.

What are the possible values of gadgets in the calendar view?

Possible values are: " icon " - The gadget displays next to the event's title in the calendar view. " chip " - The gadget displays when the event is clicked. The gadget's height in pixels. The height must be an integer greater than 0.

Why can't I schedule events with other users on my calendar?

The default is False. The attendees of the event. See the Events with attendees guide for more information on scheduling events with other calendar users. Service accounts need to use domain-wide delegation of authority to populate the attendee list. Number of additional guests.


Video Answer


1 Answers

Yes, it is a bug, if it's high priority you can 'patch' your created event with something like this:

const eventPatch = {
   conferenceData: {
   createRequest: { requestId: "yourRandomString" },
  },
};
let response = await calendar.events.patch({
  calendarId: 'primary',
  eventId: "createdEventID",
  resource: eventPatch,
  sendNotifications: true,
  conferenceDataVersion: 1,
});

Reference: https://developers.google.com/calendar/create-events#conferencing

like image 77
Diego E Lopez Avatar answered Oct 14 '22 01:10

Diego E Lopez