.Net Google Calendar API - New event has always hangout meets activated

笑着哭i 提交于 2020-06-27 18:21:10

问题


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:

  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

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

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