Retrieve MS Team Meeting Attendance Info using Graph API

This blog explores how to retrieve MS Team Meetings Info and Attendance using Microsoft Graph API.

Background

We had a client requirement to send follow-up emails to those who attended the training through Team Meetings and Schedule another training for those who could not participate.

This post will walk through the Graph API and, in the next post, how to use it using Power Automate.

Graph Explorer

To get MS team meeting information or Meeting Attendance, we have to use Microsoft Graph. Here is the generic URL

https://developer.microsoft.com/en-us/graph/graph-explorer

To get MS Team Meeting information, we need privileged access to the Graph API. To that end, Create a service account with these permissions.

1. Create a Service Account with API Permission

  • Go to https://portal.azure.com
  • Click “Azure Active Directory”
  • Click “App Registrations”
  • Click “New Registration”
  • Assign Graph API Permissions
    • OnlineMeetingArtifact.Read.All
    • OnlineMeetingArtifact.Read
    • OnlineMeetingArtifact.ReadWrite
  •  

 

2. Get the MS Team Meeting ID (*Very important *)

URL to access OnlineMeeting info using the Graph API is

https://graph.microsoft.com/v1.0/me/onlineMeetings/Encoded Meeting ID

Copy the MS team Meeting URL like

 

  • URL will like

https://teams.microsoft.com/l/meetup-join/19%3ameeting_NWZmZTQ0NTMtMGEwNy00OWU1LWJiN2ItNzRkMWFiYjdhMmVk%40thread.v2/0?context=%7b%22Tid%22%3a%22366954bc-9490-4882-b65a-48ab1a94e29c%22%2c%22Oid%22%3a%225b7dc572-b305-4054-8db3-fad82ee9ca56%22%7d

  • Decode the URL, will get like

https://teams.microsoft.com/l/meetup-join/19:meeting_NWZmZTQ0NTMtMGEwNy00OWU1LWJiN2ItNzRkMWFiYjdhMmVk@thread.v2/0?context={“Tid”:”366954bc-9490-4882-b65a-48ab1a94e29c”,”Oid”:”5b7dc572-b305-4054-8db3-fad82ee9ca56″}

At this Meeting ID is 

19:meeting_NWZmZTQ0NTMtMGEwNy00OWU1LWJiN2ItNzRkMWFiYjdhMmVk@thread.v2

  • Microsoft Graph cannot use the above Meeting ID directly. It expects the following ID format

1*{Organizer Id called Oid}*0**{Meeting id converted to base64 string}

  • Organizer id is

Oid: 5b7dc572-b305-4054-8db3-fad82ee9ca56

  • Formatted string together, you get

1*5b7dc572-b305-4054-8db3-fad82ee9ca56*0**19:meeting_NWZmZTQ0NTMtMGEwNy00OWU1LWJiN2ItNzRk MWFiYjdhMmVk@thread.v2

  • Convert the above string to Encode Base64 string

MSo1YjdkYzU3Mi1iMzA1LTQwNTQtOGRiMy1mYWQ4MmVlOWNhNTYqMCoqMTk6b WVldGluZ19OV1ptWlRRME5UTXRNR0V3TnkwME9XVTFMV0ppTjJJdE56UmtNV0ZpWWpkaE1tVmtAdGhyZWFkLnYy

3. Access Meeting Info using Graph API

    • Get Meeting Info

https://graph.microsoft.com/v1.0/me/onlineMeetings/Encoded Meeting ID

Sample

https://graph.microsoft.com/v1.0/me/onlineMeetings/MSo1YjdkYzU3Mi1iMzA1LTQwNTQt OGRiMy1mYWQ4MmVlOWNhNTYqMCoqMTk6bWVldGluZ19OV1ptWlRRME5UTXRNR0V3 TnkwME9XVTFMV0ppTjJJdE56UmtNV0ZpWWpkaE1tVmtAdGhyZWFkLnYy

 

  • Get Attendance Reports

https://graph.microsoft.com/beta/me/onlineMeetings/Ecoded Meeting ID/attendanceReports

Sample

https://graph.microsoft.com/beta/me/onlineMeetings/ MSo1YjdkYzU3Mi1iMzA1LTQwNTQtOGRiMy1mYWQ4MmVlOWNhNTYqM CoqMTk6bWVldGluZ19OV1ptWlRRME5UTXRNR0V3TnkwME9XVTFMV0ppT jJJdE56UmtNV0ZpWWpkaE1tVmtAdGhyZWFkLnYy /attendanceReports

  • Get Attendance Specific Report

https://graph.microsoft.com/beta/me/onlineMeetings/Encoded Meeting ID/attendanceReports/Report Id?$expand=attendanceRecords

Sample

https://graph.microsoft.com/beta/me/onlineMeetings /MSo1YjdkYzU3Mi1iMzA1LTQwNTQtOGRiMy1mYWQ4MmVlOWNhNTYqMCoq MTk6bWVldGluZ19OV1ptWlRRME5UTXRNR0V3TnkwME9XVTFMV0ppTjJJdE56UmtNV0ZpWWpkaE1tVmtAdGhyZWFkLnYy /attendanceReports/ff15cbf7-2ffe-4cf0-9547-e8e52d5a04f6?$expand=attendanceRecords

The next post will discuss using these Graph APIs in Power Automate to Send emails.

Reposting…Thanks for Reading!

6 comments

  1. Wow, this was such a big help. I have been trying for days to get the API to return attendance reports using the wrong and invalid meetingIDs. I kind of lost hope until I found your page. To my surprise, it worked! May I ask how you found this method? Unfortunately, I couldn’t find this information anywhere in the Graph documentation.

  2. I tried this approach in a canvas app with Custom Connector but get a 403 Forbidden error. So then tried Power Automate with HTTP Request and get same error. Did you get this to work with Power Automate?

Leave a Reply

Your email address will not be published. Required fields are marked *