Create teams meeting using microsoft graph and show it to teams UI calendar

Devinca Limto 6 Reputation points
2022-10-14T03:31:29.67+00:00

Hi teams, I want to ask if there is a way to create new meeting via microsoft graph API and show it to teams meeting calendar because the only options I found is to use this

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

However, this calendar only shown in outlook calendar not microsoft teams calendar

Outlook Calendar View
250283-image.png

Microsoft Teams Calendar View
250280-image.png

I use this example:

POST https://graph.microsoft.com/v1.0/users/:user_id/events  

Request Body  
{  
  "subject": "Let's go for lunch",  
  "body": {  
    "contentType": "HTML",  
    "content": "Does next month work for you?"  
  },  
  "start": {  
      "dateTime": "2022-10-14T13:45:00",  
      "timeZone": "Pacific Standard Time"  
  },  
  "end": {  
      "dateTime": "2022-10-14T14:45:00",  
      "timeZone": "Pacific Standard Time"  
  },  
  "location":{  
      "displayName":"Harry's Bar"  
  },  
  "attendees": [  
    {  
      "emailAddress": {  
        "address":"adelev@contoso.onmicrosoft.com",  
        "name": "Adele Vance"  
      },  
      "type": "required"  
    }  
  ],  
  "isOnlineMeeting": true,  
  "onlineMeetingProvider": "teamsForBusiness"  
}  

Is it possible if I want to create an event with API and show them in outlook calendar and teams calendar?

Thanks in advance

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,878 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 97,306 Reputation points MVP
    2022-10-14T06:55:23.94+00:00

    "Outlook calendar" is the same thing as "Teams calendar", in both cases the data is stored in the user's mailbox default Calendar folder. You example works fine for the intended purpose, and in my case appears immediately in both Outlook and Teams. A refresh or two might help (or open the browser version).
    Alternatively, you can do it via the /OnlineMeeting endpoint, which puts priority on Teams: https://learn.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=http