简体   繁体   中英

Set Online meeting in Teams

I have been using Exchange WebServices (EWS) for some time now, in Asp.net C # , to add events in the calendars of Office365 users at my work. I now needed those same events to appear at Microsoft Teams, with the possibility of going on videoconference. Events appear but that possibility is not present.

One of the properties of " appointments " is " isOnlineMeeting ". I tried to add it, making it true , but it always returns an error saying "Set action is invalid for property.".

In the online searches I have done, I have found that this is a read-only property.

So, is there any chance that I can "force" this property?

I have already configured my Exchange so that, in Outlook online when we do a new event, this is always by videoconference.

Some help?

Thank you!

UPDATE : By the way, the code that I'm using is:

try {
        ExchangeService service = new ExchangeService (ExchangeVersion.Exchange2013_SP1, TimeZoneInfo.FindSystemTimeZoneById ("GMT Standard Time"));
            service.Url = new Uri ("https://outlook.office365.com/EWS/Exchange.asmx");

            string User = "a@a.net";
            string Password = "AAA";

            service.Credentials = new NetworkCredential (User, Password);

            Appointment appointment = new Appointment (service);

            appointment.Subject = "Experiment";

            appointment.Location = "Videoconference";

            string dataStart = "10-02-2021 19:00:00.000";
            string dataEnd = "10-02-2021 20:00:00.000";
            appointment.Start = DateTime.Parse (dataStart);
            appointment.End = DateTime.Parse (dataEnd);

            appointment.Body = "<strong>Ignore! Just a test</strong>";

            appointment.IsOnlineMeeting = true;

            appointment.RequiredAttendees.Add ("b@a.net");

            appointment.Save (SendInvitationsMode.SendOnlyToAll);

        } catch (Exception ex) {
            
        }

Posting the Answer for better knowledge

Copying from comments

Could you please try with this document by using Graph API. By using Graph API we can set "isOnlineMeeting" property to true, and "onlineMeetingProvider" property to "teamsForBusiness".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM