Google 日历 API 下降 "conferenceData" 嵌套 object

Google Calendar API drops "conferenceData" nested object

编辑:这已被识别为 bug here

我正在尝试举办一个 Google 会议以及一个新的日历活动。但是,出于某种原因,returning 事件不包含任何会议数据,甚至没有状态为 fail 的数据。

这是我的代码。我省略了身份验证步骤,因为我没有收到身份验证错误。

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']

这 return 是一个关键错误,因为会议数据不存在。这是完整的 'ret' object 在我 运行 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': '5fb6epfe93sceba9scjt1nevsk@google.com', 'sequence': 0,
     'attendees': [{'email': '[my other email]', 'displayName': 'Forrest Milner', 'responseStatus': 'needsAction'}],
     'reminders': {'useDefault': False}}

谁能告诉我为什么我请求的 conferenceData 部分可能会被删除?我将 conferenceDataVersion 设置为 1,并使用随机字符串。

我试过添加虚拟“受邀者”。在这次试用中,我邀请了我的第二个 gmail 帐户,在其他试用中,我邀请了几个域名为“example.com”的虚拟帐户。这会更新与会者,但不会显示会议数据。

我也试过等几分钟,然后列出我所有的事件。即使在等待之后,会议数据也没有填写。当我在 GUI (https://calendar.google.com/calendar/r) 上查看我的日历时,它也没有附加 Google 会议。

感谢您的帮助。

是的,这是一个错误,如果它具有高优先级,您可以 'patch' 您创建的事件,如下所示:

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

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

conferenceDataVersion 它不再是 requestBody 的一部分。必须在您的插入方法中传递。 在 NodeJS 上是这样的:

calendar.events.insert({
    calendarId: 'calendarIdHere',
    requestBody: yourOldRequestBodyObject,
    conferenceDataVersion: 1
});

@André Eccel 是正确的。这是一个有效的 Python 示例,说明如何将 google 聚会 link 添加到您的活动中:

import uuid

request_id = str(uuid.uuid1())

event = {'summary': "My Birthday Party",
         'description': "There will be flamingos.",
         'start': start,
         'end': end,
         'recurrence':recurrence,
         'attendees': attendees,
         'conferenceData': {'createRequest': {
               'requestId': request_id,
               "conferenceSolutionKey": {"type": "hangoutsMeet"}}}
        }

service.events().insert(calendarId=cal_id,body=event,conferenceDataVersion=1).execute()