Using Graph API to create a instant meeting in Teams

Graph API is a getting better all the time. New capabilities are being added and it eventually means more automation that can occur inside Teams. I was exploring Graph API possibilities recently to my upcoming SharePoint Saturday session. This time I concentrate on creation a instant meeting. The Meet Now functionality is actually in Graph API already, but the button to UI version of it is not yet out (it will appear to Teams Calendar app).

The Graph API call

The fun: MeetNow is done in Graph API using application permissions. So a bot, application or a Flow / Logic Apps can create a Teams meeting. No, it is not a scheduled one but it is available instantly. To see Graph API documentation head to docs.microsoft.com article.

I tested this one with a simple code, using my own user ID in a demo environment.

{
  "meetingType": "meetNow",
  "participants": {
    "organizer": {
      "identity": {
        "user": {
          "id": "[myUserId-Guid]"
        }
      }
    }
  },
  "subject": "MeetNow from Graph API"
}

That’s the call body. Simple, effiecient. That could be easily done in many applications. Then execute the call

POST https://graph.microsoft.com/beta/app/onlineMeetings

From the response you can isolate easily the most important information

  • joinURL

Send that joinURl into participants you want to add into a meeting. But there is more in that meeting.

Use the Chat, Luke.

Application can also write information to the meeting chat. Perhaps some background information is needed, links to documents – you name it. Writing a chat however happens with delegated permissions only. We can get that meeting chat information from the MeetNow.

  • chatInfo.threadId
POST https://graph.microsoft.com/beta/chats/[threadId]/messages
The actual body is easy to create:
{
  "body": {
     "content" : "Hello into meeting chat from Graph API!!"
  }
}

What might be also useful, is to get a transcript of the meeting chat afterwards. However, executing that with application permissions requires approval from Microsoft and raises other questions as well. Running it using delegated permissions works with less hassle and it is also ethical (user participated in the chat).

https://graph.microsoft.com/beta/chats/[threadId]/members 
lists all participants and 
GET https://graph.microsoft.com/beta/chats/[threadId]/messages 
returns all messages in that chat

Retreiving meeting participants can be done by an application. This could be used for sharing some information automatically to all participants later on, for example.

There are lots of great ways to use Teams Graph API to meet the needs – but remember that many of these APIs are still are still in beta phase and should not be used in actual production. Piloting and POCing however is a another story.

8 thoughts on “Using Graph API to create a instant meeting in Teams

  1. Hi ,

    I am trying your suggestion in my solution using Microsoft Power automate, But can you please let me know how can I specify the channel where I need to create the meeting invite?

    Like

  2. I created teams meeting using graph api. I am not getting start url to start meeting. How to start the meeting as organizer. Please help

    Like

    1. Thank you for the comment. After a few quick tests and checking Docs-documentation the reason is quite clear. /app path is deprecated in Teams Graph API and thus this article is no longer up to date.
      You might want to check how to create a new event and set isonlinemeeting true.
      https://docs.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-beta&tabs=http
      https://docs.microsoft.com/en-us/graph/api/application-post-calls?view=graph-rest-beta&tabs=http

      Like

  3. We use this for our incidents. We have a bot that creates these meetings. However, if folks join late to a meeting, they cannot see the previous chat history. Have you guys experienced this as well? Any tips or suggestions?

    Like

    1. That is issue with some meetings. Some workarounds: use a channel meeting (if attendees are part of the team) to overcome that chat history issue. You can also think about reusing the meeting if your attendees are same as before – so you just keep on continuing the original meeting.
      Or if possible – try to engage people in advance to join the meeting chat. Of course you are talking about instant meetings here that react to immediate needs. I would look into channel meetings if your situation would make those usable.

      Like

      1. So I’ll follow up with that. Thanks for the quick response.

        Our meet now meetings attached to an incident are for folks that do not know an issue exists. When they get paged into a call and join they cannnot see the history. This spans across hundreds of teams and no specific team member.

        Since these meetings are created on the fly and not from teams or outlook, our automation creates it and throws the teams meeting into a platform for folks to join. Does exploring channel meeting still make sense?

        Like

  4. That might be a bit confusing situatiion for channel meetings. All your team members would have to be in the team (10k members is currently supported) but after that a channel meeting would make these discussions visible to all members – in a meeting or not – allowing more transparency.

    However usually that means a lot of information to people that they wouldn’t want to see – or perhaps some information is something the others are not allowed to see at all. That may make use of channel meetings impossible.

    You can instruct people to change the meeting chat notification to Unmute (default is mute until they join) to make it possible to ping them and adding them to the meeting. However that notification is a personal setting and can not be forced to everyone.

    Meeting practices is one thing: lead adds required people to the meeting and chat use is kept minimal until everyone has joined.

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.