azuremicrosoft-graph-apimicrosoft-graph-teams

Getting Microsoft Teams Calls For the member


I am working on a task that requires integration with Microsoft Teams Calls, I want to retrieve the calls form the users, I Explored Microsoft Graph API and found this api: GET /communications/callRecords. But it requires an application permission which I cannot have. Is there another API I can use that requires delegated permissions like: CallEvents.Read. Permissions I have


Solution

  • To retrieve the call records from your Microsoft Teams

    Initially, Registered Single Tenant Microsoft Entra ID Application:

    enter image description here

    Note: For retrieving the call records from your Microsoft Teams Calls tab, You need to Add Application type CallRecords.Read.All only and Grant admin Consent, No other API permission is supported for retrieving the call records.

    CallEvents.Read delegated type API permission does not have any graph methods published. For more details Refer this Document

    Added Application type CallRecords.Read.All permission and Granted Admin Consent:

    enter image description here

    As, CallRecords.Read.All is Application type permission need to use client_credentials flow for generating access token where user-interaction is not involved.

    Use below parameters to generate Access token:

    GET https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
    Content-Type: application/x-www-form-urlencoded
    
    client_id: <application-id>
    client_secret: <client-secret>
    scope: https://graph.microsoft.com/.default
    grant_type: client_credentials
    
    

    Response:

    enter image description here

    Now used same access token to list all the call records.

    To list the all call records:

    HTTP Request:

    GET https://graph.microsoft.com/v1.0/communications/callRecords
    

    enter image description here

    Also, I've verified from Microsoft Teams App the call records is present.

    enter image description here

    As you want to list 25 recent call record, Use below HTTP request:

    GET https://graph.microsoft.com/v1.0/communications/callRecords?$top=25&$orderby=startDateTime desc
    

    Reference:

    List CallRecords

    Odata query parameter