How to get CallId or CallChainId through graph api, without utilising callRecords or Creating a call through "communications/calls"

vivek 0 Reputation points
2025-02-04T14:10:18.3566667+00:00

So I am getting webhooks by subscibing to /chats/getAllMessages

Now I am able to retrieve "callId" whenever the user enables Recording for their meetings. However I am not able to retrieve "callId" for events like

#microsoft.graph.callStartedEventMessageDetail	


On getting the OnlineMeeting through

GET /me/onlineMeetings?$filter=JoinWebUrl%20eq%20'{joinWebUrl}'


I am still not able to retrieve "callId", as there is no such field in the response body.
I am not able to utilise

GET /communications/callRecords

As I require callId of ongoing meetings.
Is there anyother workaround for this ?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,808 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,954 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Techhelp Volunteer 0 Reputation points
    2025-02-04T15:08:59.5866667+00:00

    I will try to share some information.

    To retrieve the callId or callChainIdfor ongoing meetings without using callRecords or creating a call through communications/calls, you can leverage the Microsoft Graph API's event-based subscriptions and the data available in the event messages. Here’s a step-by-step approach to achieve this:

    1. Subscribe to Event Notifications

    You are already subscribing to /chats/getAllMessages, which is a good start. This subscription will notify you of various events, including callStartedEventMessageDetail.

    1. Parse Event Messages

    When you receive an event notification, parse the message to extract relevant details. For callStartedEventMessageDetail, you should look for the callId or callChainId in the event details.

    1. Use Online Meetings API

    You mentioned using the GET /me/onlineMeetings endpoint. While this endpoint does not directly provide the callId, it can give you the joinWebUrl and other meeting details. You can use these details to correlate with the events you receive.

    1. Correlate Events with Online Meetings

    When you receive a callStartedEventMessageDetail, you can correlate it with the online meeting details using the joinWebUrl or other unique identifiers. This way, you can associate the callId with the specific meeting.

    Example Workflow

    Subscribe to Event Notifications:

    http

    Copy

    POST https://graph.microsoft.com/v1.0/subscriptions
    

    Receive and Parse Event Notifications: When you receive a notification, parse the event message to extract details:

    json

    Copy

    {
    

    Retrieve Online Meeting Details: Use the joinWebUrl to get the online meeting details:

    http

    Copy

    GET https://graph.microsoft.com/v1.0/me/onlineMeetings?$filter=JoinWebUrl eq 'https://teams.microsoft.com/l/meetup-join/19:meeting_XYZ'
    

    Correlate callId with Online Meeting: Use the callId from the event message and correlate it with the online meeting details.

    Example Code Snippet (Python)

    Here’s a simple example in Python to illustrate the process:

    python

    Copy

    import
    
    

    By following these steps, you can try to retrieve the callId or callChainIdfor ongoing meetings without directly using callRecords or creating a call through communications/calls. This approach leverages event-based notifications and correlates them with online meeting details to achieve your goal.

    0 comments No comments

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.