microsoft-teamsmicrosoft-graph-teams

Cant create Microsoft Teams online meetings for some users (Defaults to OnlineMeetingProvider.Unknown) via Graph Api


I have 5 users, they all look the same in Office 365 (from what I can see anyway) and have Teams Exploratory licences. I am able to create online meetings (OnlineMeetingProvider="teamsForBusiness" and IsOnlineMeeting=true) for 2 of them. For the other 3 users it doesn't error but doesn't create an online meeting (creates an event?), the response OnlineMeetingProvider is "unknown" and the OnlineMeeting is null. It is the same code so has to be a setting somewhere (all i do is change the id of the user).

The code used to create the request:

// Create client
var graphServiceClient = CreateGraphClient();

// Build event
var newEvent = new Event()
{
     Subject = subject,
     Body = new ItemBody() { ContentType = BodyType.Text, Content = body },
     Start = startDate,
     End = endDate,
     IsOnlineMeeting = true,
     Attendees = attendees == null ? null : GetAttendees(attendees),
     OnlineMeetingProvider = OnlineMeetingProviderType.TeamsForBusiness
};

The erroneous response: enter image description here

Anyone have any idea what is going on?


Solution

  • Had the same problem, I had to add these permissions to the app I was using to create the meeting events:

    TeamSettings.Read.All, TeamSettings.ReadWrite.All

    As soon as I added them, isOnlineMeeting was correctly set to true, and onlineMeetingProvider was set to teamsForBusiness, as specified in the request.

    onlineMeetingUrl is always null, but it's possible to get the meeting url from the "onlineMeeting.joinUrl" property, which is automatically populated by the API.

    UPDATE: As @lokusking pointed out, even if this is correct, it looks like it does not completely solve the problem. According to my tests, creating a Team event for a new user and getting isOnlineMeeting=true and onlineMeeting properly populated in the response will work only a couple of hours after the user account is created. Note that even with a fresh user the event IS created, just those properties won't contain the right values.