问题
In my .Net test app I run the following code. The new calendar event is successfully created but it has hangout meets conference on the event. How can i disable the automatically creation of an hangout meet conference on the event?
I have tried to set body.ConferenceData = null but it doesn't has any effect. Using the CalendarService.Events.Patch method after the Insert method is also not working.
It also not possible to assign an existing conference by filling the fields in body.ConferenceData using ConferenceSolution class - its completely ignored and the conference is always created new.
Event body = new Event();
EventAttendee a = new EventAttendee();
a.Email = "test@test.de";
List<EventAttendee> attendes = new List<EventAttendee>();
attendes.Add(a);
body.Attendees = attendes;
EventDateTime start = new EventDateTime();
start.DateTime = Convert.ToDateTime("2020-04-14T09:00:00");
EventDateTime end = new EventDateTime();
end.DateTime = Convert.ToDateTime("2020-04-14T11:00:00");
body.Start = start;
body.End = end;
body.Location = "Room";
body.Summary = "test description";
Event newEvent = CalendarService.Events.Insert(body, MyCalendarID).Execute();
回答1:
Only for G Suite accounts
To disable Meet conferences being automatically Added to any event created from the API:
- As an Admin, go to
admin.google.com
- Go to Apps > G Suite > Settings for Calendar > Sharing Settings
- Set
Video Calls
toOFF
To manually add a conference to your Event:
Add conferenceData with an empty Id to generate a new Meet conference when doing an insert request:
Request body:
{
"end": {
"dateTime": "2020-05-28T09:00:00-07:00"
},
"start": {
"dateTime": "2020-05-27T09:00:00-07:00"
},
"attendees": [
{
"email": "example@gmail.com"
}
],
"conferenceData": {
"conferenceId": ""
}
}
来源:https://stackoverflow.com/questions/61253548/net-google-calendar-api-new-event-has-always-hangout-meets-activated