News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Getting Call Session Status for Call Log records
Tags: rest api
Jun 29, 2021 at 1:10pm   •   1 replies  •  0 likes
Greg Rossi

I have an application that downloads call logs. I would like to get the Call Session Status for each call log record. However, I get 404s when accessing the telephony/sessions endpoint. No doubt this is something simple; I'm hoping that someone can give me a pointer.

The app is provisioned with Call Control and Read Call Log permissions.

In the API explorer, I authenticate with the app in the sandbox. Issuing a request against the call-log endpoint returns records like this:

{
  ...
  "records": [
    {
      "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/297618004/extension/297618004/call-log/AiIqKidyZEHuzUA?view=Simple",
      "id": "AiIqKidyZEHuzUA",
      "sessionId": "25791899004",
      "startTime": "2021-06-29T18:14:30.968Z",
      "duration": 19,
      "type": "Voice",
      "internalType": "LongDistance",
      "direction": "Outbound",
      "action": "RingOut PC",
      "result": "Call connected",
      "to": {
        "phoneNumber": "+1512587XXXX",
        "location": "Austin, TX"
      },
      "from": {
        "name": "Mike XXXX",
        "phoneNumber": "+1424316XXXX",
        "extensionId": "29761XXXX"
      },
      "extension": {
        "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/297618004/extension/297618004",
        "id": 29761XXXX
      },
      "telephonySessionId": "s-3e9b01063b6042548ba69b8f4975800b"
    },
    ...
  ],
  ...
}

If I drop the telephonySessionId value from the above response into the API explorer and hit the telephony/sessions endpoint, I get a 404. The curl command from API explorer:

curl --request GET \
  --url 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/telephony/sessions/s-3e9b01063b6042548ba69b8f4975800b' \
  --header 'accept: application/json' \
  --header 'authorization: Bearer ...

The response is:

HTTP/1.1 404 Not Found

Server: nginx
Date: Tue, 29 Jun 2021 19:55:51 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
X-Rate-Limit-Group: light
X-Rate-Limit-Limit: 50
X-Rate-Limit-Remaining: 49
X-Rate-Limit-Window: 60
RoutingKey: SJC11P01
RCRequestId: 017a339e-d914-11eb-aa39-005056bb4bfe
Connection: keep-alive

It would appear that the telephonyStatusId is incorrect and thus causes a 404.

What is the correct way to do this? If the telephonySessionId from the call log is not the correct value, where do I find it?

1 Answer
answered on Jun 30, 2021 at 6:45am  

This is totally incorrect and 404 response is expected.

A call session status exists only when a call is active. When you read the call log, you read completed calls info. Thus, the active call is no longer existed.

Try again with the get user or company active calls API to read active calls, get the telephonySessionId of that active call and call the get call session status.


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us