使用 Google Calendar .Net SDK 从 Google 日历活动中删除 Google Meet link

Remove Google Meet link from Goocle Calendar Event using Google Calendar .Net SDK

我在我的项目中使用 Google.Apis.Calendar.v3 .NET Nuget 包来创建 google 日历事件。但它会自动将 Google Meet link 添加到我不想参加的活动中。

当我创建活动时,会向参加者发送通知邮件,其中包含以下字符串:

加入信息 加入 Google 会见 meet.google.com/******

如何从我的活动中删除 Google Meet。我试图将此 ConferenceData 属性 添加到事件 object 并将其值设置为 null 但仍然 Google 会议在 Google 日历事件中可见。

     Event calendarEvent = new Event
            {
                ... ,
                ConferenceData = null
            };

如果您使用的是 G Suite 帐户,您可以按照 this question 的答案进行操作:

To disable Meet conferences being automatically Added to any event created from the API:

  1. As an Admin, go to admin.google.com
  2. Go to Apps > G Suite > Settings for Calendar > Sharing Settings
  3. Set Video Calls to OFF

此外,我建议您查看 Add video and phone conferences to events 的指南。

里面有一些关于如何修改事件的说明:

The conferenceData field can be used to read, copy, and clear existing conference details; it can also be used to request generation of new conferences. To allow creation and modification of conference details, set the conferenceDataVersion request parameter to 1.

PHP 我是这样实现的:

$event_data = array(
        'summary' => $event->getSubject(),
        'location' => $event->getLocation()->getDisplayName(),
        'description' => $html,
        'start' => array(
            'dateTime' => $event->getStart()->getDateTime(),
            'timeZone' => $event->getStart()->getTimeZone(),
        ),
        'end' => array(
            'dateTime' => $event->getEnd()->getDateTime(),
            'timeZone' => $event->getEnd()->getTimeZone(),
        ),
        'reminders' => [
            'useDefault' => true,
        ],
        'attendees' => array(
            array('email' => 'lpage@example.com'),
            array('email' => 'sbrin@example.com'),
        ),
        'conferenceData' => null,
    );

$google_event_insert = $service->events->insert($calendarId, $google_event, ['conferenceDataVersion' => 1]);

从上面的代码中,请注意,我们将“conferenceData”作为 null 发送 + 添加查询参数 conferenceDataVersion=1 到插入请求。

这对我来说非常好用。您可以在 .net 代码中以类似的方式使用它。