Inconsistent API Errors with Webhook Events: Could not find the requested call record. Records about calls or online meetings that started more than 30 days ago are not available.

Anand Tiwari 0 Reputation points
2024-05-14T09:30:18.9133333+00:00

Hello Team,

We have implemented a Teams webhook to receive events whenever a Teams call ends. Upon receiving the webhook from Microsoft, we are making another call to the Microsoft Graph API service to retrieve the details of the call record using the callRecordId .


import { MSGraphClient } from './MSGraphClient';
import { CallRecords } from '@microsoft/microsoft-graph-types';

export class MSCallRecord extends MSGraphClient {
  private resourcePath = '/communications/callRecords';
  constructor(accessToken: string) {
    super(accessToken);
  }
  async getCallRecord(callRecordId: string) {
    return await this.client
      .api(`${this.resourcePath}/${callRecordId}`)
      .expand('sessions')
      .get();
  }
}

// API call to get the call record details

 const callRecord = await new MSCallRecord(accessToken).getCallRecord(
      callRecordId,
    );
  

We are encountering an issue while making the API call to retrieve call record details using the callRecordId received from the Microsoft Teams webhook. The error message indicates that the call record is older than 30 days. However, upon retrying the same call, the error is not reproduced, and the API call succeeds.

It's worth noting that our code implementation includes two retries before sending the request to the Dead Letter Queue (DLQ). Interestingly, when we retrieved the message from the DLQ the next day and attempted the API call again with the same callRecordId, it succeeded without any errors.
We're seeking assistance to understand why this inconsistency occurs.

{
  "errorType": "Error",
  "errorMessage": "Could not find the requested call record. Records about calls or online meetings that started more than 30 days ago are not available.",
  "code": "NotFound",
  "statusCode": 404,
  "requestId": "************",
  "date": "2024-05-09T18:50:19.000Z",
  "body": "{\"code\":\"NotFound\",\"message\":\"Could not find the requested call record. Records about calls or online meetings that started more than 30 days ago are not available.\",\"innerError\":{\"date\":\"2024-05-09T18:50:19\",\"request-id\":\"*************\",\"client-request-id\":\"*************\"}}",
  "headers": {},
  "stack": [
    "Error: Could not find the requested call record. Records about calls or online meetings that started more than 30 days ago are not available.",
    "    at new GraphError (/var/task/dist/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphError.js:34:28)",
    "    at GraphErrorHandler.constructErrorFromResponse (/var/task/dist/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:63:22)",
    "    at Function.<anonymous> (/var/task/dist/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:91:48)",
    "    at step (/var/task/dist/node_modules/tslib/tslib.js:195:27)",
    "    at Object.next (/var/task/dist/node_modules/tslib/tslib.js:176:57)",
    "    at /var/task/dist/node_modules/tslib/tslib.js:169:75",
    "    at new Promise (<anonymous>)",
    "    at Object.__awaiter (/var/task/dist/node_modules/tslib/tslib.js:165:16)",
    "    at GraphErrorHandler.getError (/var/task/dist/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:87:24)",
    "    at GraphRequest.<anonymous> (/var/task/dist/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphRequest.js:315:84)"
  ]
}


Your insights or assistance in troubleshooting this issue would be greatly appreciated. Thank you for your attention to this matter.

Looking forward to your response.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,772 questions
0 comments No comments
{count} votes