Issue with Graph API for Teams getting the onlineMeetingId.

Daniel Ramírez 1 Reputation point
2022-11-30T22:04:31.02+00:00

I'm developing an attendance tool for meeting in Microsoft Teams in .NET MAUI, to do that, I need to obtain the meetingAttendanceReport to be able to retrieve the data of each meeting. To get that report I need the onlineMeetingId and the reportId. In this app, I retrieve all the events in the user calendar, select one, and get the ID of that event. But when I try to use that ID in the Get onlineMeeting request I get a NullExceptionError, meaning that the method didn't retrieve any value. My doubt is that I don't know if the event Id works to get the onlineMeeting request, or what do I need to get it?
I'll attach the method I'm trying to use to get the onlineMeeting request.

265912-getonlinemeetingmethod.png

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,555 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,722 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,415 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 6,066 Reputation points
    2022-12-01T01:43:17.52+00:00

    Hi @Daniel Ramírez

    To retrieve the Online Meeting Id please follow the below steps:

    • Get Events where isOnlineMeeting is true
      Use this https://graph.microsoft.com/v1.0/me/events?$select=id,isOnlineMeeting Graph API endpoint
    • Now Get Joining web URL
      Use this https://graph.microsoft.com/v1.0/me/events/{event-id} Graph API endpoint to get Join Web URL in API response
    • Now use the above Join Web URL to get Online Meeting id
      Use this https://graph.microsoft.com/v1.0/me/onlineMeetings?$filter=JoinWebUrl eq 'Web-Url'

    In the response you will get Online Meeting ID. Now you can use this id to get attendance report.
    Use this https://graph.microsoft.com/v1.0/me/onlineMeetings/{meetingId}/attendanceReports/{reportId} Graph API endpoint.

    Please note: To get online Meeting id for user/{user-id} you need to create Application access Policy.

    For more details please refer to the below documentations.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.