How to get the call-id in Microsoft Teams?

Ottmann, Thomas 20 Reputation points
2024-02-14T13:47:07.57+00:00

Is it possible to get the call-id from a running Teams call? I should get call details from https://graph.microsoft.com/v1.0/communications/calls I want to use the call-id here:

var result = await graphClient.Communications.Calls["{call-id}"].GetAsync();

For example, we have a call between user1 and user2. Are there any possibilities to get the call-id of this running call? I don´t want to use callRecords because i need the call-id during the call to work with this during the call.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
8,992 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,118 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,448 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,814 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JasonPan - MSFT 4,196 Reputation points Microsoft Vendor
    2024-02-15T06:53:41.9733333+00:00

    Hi @Ottmann, Thomas, According to the official document, the call resource is created when there's an incoming call for the application or the application creates a new outgoing call via a POST on communications/calls. User's image

    User's image

    The picture shows a request using http request, which should be consistent with the return information using the C# SDK.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Jason

    0 comments No comments

  2. Prasad-MSFT 5,531 Reputation points Microsoft Vendor
    2024-02-28T10:32:33.7333333+00:00

    It is not possible to get the call-id of a running call in Microsoft Teams. The call-id is only available after the call has been completed. You can get the call-id from the call history in the Teams Admin Center or by subscribing to change notifications for the /communications/callRecords endpoint.
    Ref: https://learn.microsoft.com/en-us/graph/api/resources/change-notifications-api-overview?view=graph-rest-1.0

    Another way to get the call-id is by using the callChainId property of a call.
    Ref: https://learn.microsoft.com/en-us/graph/api/resources/call?view=graph-rest-1.0#properties However, keep in mind that the call record is only available after the associated call has been completed.

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    0 comments No comments