Reputation: 51
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.
Upvotes: 5
Views: 2726
Reputation: 143
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': '[email protected]'
}
],
'reminders': {
'useDefault': true
},
'conferenceData' : null
};
calendar.events.insert({
auth: oauth2Client,
calendarId: 'primary',
conferenceDataVersion: 1,
resource: event,
sendNotifications: false,
email: '[email protected]'
}, function (err, event) {
if (err) {
console.log(err)
}
console.log(event)
});
Upvotes: 5
Reputation: 12673
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
}
Upvotes: 5