How to disable Google’s “Video Call” default in Calendar Api?

孤者浪人 提交于 2019-12-05 02:06:16

问题


I'm implementing a software that creates an event in a calendar, but when I create it, Google adds a hangout (video call) link by default. Thats make the event a bit confusing.

I know that you can eliminate this by going to the user advanced options and untick the option, but I cant access it. I'm using java and OAuth 2.0 to get the token with the permissions, and calendar v3 api to create the event.

Is there anyway you can eliminate this hangout link throughout code?

In the documentation I've found: myEntry.setHangoutLink(null); but it still doesn't work.


回答1:


Edited 2018-09-19

You can remove the Hangout from a Google Calendar event by making an Events.patch request, ensuring you set the query parameter conferenceDataVersion to 1 and with a body that sets conferenceData to null. For example:

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

{
 "conferenceData": null
} 



回答2:


If anyone is still looking for the solution. Here is an example of how we have done it using npm module googleapis.

This is done during 'insert' and not during 'patch'. Please note that 'conferenceData' is null and conferenceDataVersion is set to 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)
});


来源:https://stackoverflow.com/questions/26711435/how-to-disable-google-s-video-call-default-in-calendar-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!