Need tenant wide access to Teams meeting and recording info and recording content.

Mike Yeager 26 Reputation points
2024-06-03T15:55:24.1466667+00:00

We created a tenant wide subscription to be notified of newly created recordings and got that to work. We have to manually parse out the MeetingId and RecordingI from the returned URL fragment. We then use that information to get the meeting information:

                var meeting = await _graphServiceClient
                    .Users[_staticUserId]
                    .OnlineMeetings[meetingId]
                    .GetAsync(r => r.Options.WithAppOnly());

And the recording information:

                var recordingInfo = await _graphServiceClient
                    .Users[_staticUserId]
                    .OnlineMeetings[meetingId]
                    .Recordings[recordingId]
                    .GetAsync(r => r.Options.WithAppOnly());

And finally, we get the Stream to download the content and begin downloading it:

                var recordingStream = await _graphServiceClient
                    .Users[_staticUserId]
                    .OnlineMeetings[info.MeetingInfo.Id]
                    .Recordings[info.RecordingInfo.Id]
                    .Content
                    .GetAsync(r => r.Options.WithAppOnly());

Notice that all of these calls require a User. However, the notification contains no indication of the meeting organizer or invited attendees.

{
  "subscriptionId": "6aa5ced2-xxxx-xxxx-xxxx-3109c731d986",
  "changeType": "created",
  "tenantId": "<<--TenantForWhichNotificationWasSent-->>",
  "clientState": "<<--SpecifiedClientState-->>",
  "subscriptionExpirationDateTime": "2023-09-17T08:27:05.0241757+00:00",
  "resource": "communications/onlineMeetings('M ... LnYy')/recordings('VjI ... zI=')",
  "resourceData": {
    "id": "VjIjIzE5NzZ ... 2NDJlNzI=",
    "@odata.type": "#Microsoft.Graph.callRecording",
    "@odata.id": "communications/onlineMeetings('M ... LnYy')/recordings('VjI ... zI=')"
  }
}

Our need is to automatically process all recordings across the tenant. The notification system allows for that, but once we receive the notification, we need to specify a user Id to do anything with the notification. This seems counter intuitive. We would like our App Registration to have access to all meeting and recording information and content. We'd also prefer to not have to parse the meeting and recording Ids from the resource: node of the notification. Are we approaching this the wrong way somehow? Thanks in advance.

Mike

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,454 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,202 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.
2,996 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 1,795 Reputation points Microsoft Vendor
    2024-06-04T01:42:40.6533333+00:00

    Hi @Mike Yeager

    According to the Graph Api, if application permissions are to be used, the tenant administrator must create an application access policy and grant it to the user, as shown in the following figure.

    User's image

    See the link below for details:

    https://learn.microsoft.com/en-us/graph/api/callrecording-get?view=graph-rest-1.0&tabs=http#permissions

    It's worth mentioning that this API doesn't support getting call recordings from channel meetings.

    Hope this helps.

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