question

Fazaldhar M avatar image
Fazaldhar M asked Phong Vu answered

How to filter the callRecord using sessionId?

I use an embeddable method to integrate ring central to my web app.

In an "rc-call-end-notify" event, I get

call: {
 "partyData": {
    "partyId": "p-123",
    "sessionId": "s-123"
  },
}

I am trying to fetch the call log using the sessionId.

First, I tried to get the call logs using the API

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/call-log

I get the same sessionId "s-123' under "telephonySessionId" key in the response.

Then, i tried to filter out with the "s-123' using an API

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/call-log?sessionId=s-123

Which says,

{
  "errorCode": "InvalidParameter",
  "message": "Parameter [s-123] value is invalid.",
  "errors": [
    {
      "errorCode": "CMN-101",
      "message": "Parameter [s-123] value is invalid.",
      "parameterName": "s-123"
    }
  ],
  "parameterName": "s-123"
}


What should be corrected here?

rest apicall logs
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered

The name 'sessionId' in the partyData object is misleading. It is in fact, the 'telephonySessionId' and it cannot be used to search for a call record from the call log.

You should catch the ''rc-telephony-session-notify' event, and parse the event payload to get the correct 'sessionId' and use it to search for the call record from the call log.

The correct sessionId is something like this

sessionId : "914670386016"
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys