microsoft-graph-apimicrosoft-graph-teamsoutlook-calendar

Using graphClient, successfuly created meeting does not show up in Calendar


I am creating a Teams meeting using graphClient successfully with the following code:

var meeting = new OnlineMeeting
{
    Subject = "demo meeting for user",
    StartDateTime = DateTimeOffset.Now.AddMinutes(10),
    EndDateTime = DateTimeOffset.Now.AddMinutes(30),
    RecordAutomatically = true,
    Participants = new MeetingParticipants
    {
        Organizer = new MeetingParticipantInfo
        {
            Identity = new IdentitySet
            {
                User = new Identity
                {
                    Id = userid
                }
            }
        }
    }
};
var result = await _graphClient.Users[userid].OnlineMeetings.PostAsync(meeting);

Using the meeting link in the result variable I can join to the meeting. Also I see the recording is automatically on, according the my meeting variable's RecordAutomatically = true.

However if I use the Teams app, and logging on as user which's guid is in the userid variable, I do not see the meeting in the Calendar.

What am I missing?


Solution

  • When you use the onlinemeeting endpoint that's to be expected

    This API creates a standalone meeting that isn't associated with any event on the user's calendar; therefore, meetings created via this API aren't shown on the user's calendar.

    ref https://learn.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=http

    If you want to create a Meeting that shows up in the calendar and is a Online Teams meeting you need to use Create Event see the sample in https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http#example-4-create-and-enable-an-event-as-an-online-meeting and set the isOnlineMeeting property