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.

Vastaa

Täytä tietosi alle tai klikkaa kuvaketta kirjautuaksesi sisään:

WordPress.com-logo

Olet kommentoimassa WordPress.com -tilin nimissä. Log Out /  Muuta )

Google photo

Olet kommentoimassa Google -tilin nimissä. Log Out /  Muuta )

Twitter-kuva

Olet kommentoimassa Twitter -tilin nimissä. Log Out /  Muuta )

Facebook-kuva

Olet kommentoimassa Facebook -tilin nimissä. Log Out /  Muuta )

Muodostetaan yhteyttä palveluun %s

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