如何在日历 Api 中禁用 Google 的“视频通话”默认设置?

M91*_*19M 5 java calendar google-calendar-api google-api call

我正在实施一个在日历中创建事件的软件,但是当我创建它时,谷歌默认添加了一个环聊(视频通话)链接。这让事件有点混乱。

我知道您可以通过转到用户高级选项并取消选中该选项来消除此问题,但我无法访问它。我正在使用 java 和OAuth 2.0 来获取具有权限的令牌,并使用日历v3 api来创建事件。

无论如何,您是否可以在整个代码中消除此环聊链接?

在我发现的文档中: myEntry.setHangoutLink(null); 但它仍然不起作用。

Eri*_*eda 5

已编辑 2018-09-19

您可以通过发出请求从 Google 日历活动中删除环聊Events.patch,并确保将查询参数设置conferenceDataVersion1且正文设置conferenceDatanull。例如:

POST https://www.googleapis.com/calendar/v3/calendars/primary/events/{EVENT_ID}
     ?conferenceDataVersion=1
Authorization: Bearer {ACCESS_TOKEN}

{
 "conferenceData": null
} 
Run Code Online (Sandbox Code Playgroud)


小智 5

如果有人仍在寻找解决方案。这是我们如何使用 npm 模块 googleapis 完成它的示例。

这是在“插入”期间而不是在“补丁”期间完成的。请注意,'conferenceData' 为 null,conferenceDataVersion 设置为 1。

var event = {
    'summary': 'some summary data here',
    'location': 'some location',
    'description': 'add your description',
    'start': {
        'dateTime': 'add your start time here',
    },
    'end': {
        'dateTime': 'add your end time here',
    },
    'attendees': [{
            'email': 'attendee1@email.com'
        }
    ],
    'reminders': {
        'useDefault': true
    },
    'conferenceData' : null
};

calendar.events.insert({
    auth: oauth2Client,
    calendarId: 'primary',
    conferenceDataVersion: 1,
    resource: event,
    sendNotifications: false,
    email: 'youremail@emailprovider.com'

}, function (err, event) {
    if (err) {
        console.log(err)
    }
    console.log(event)
});
Run Code Online (Sandbox Code Playgroud)