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
Check SMS history
Tags: sdk
Sep 13, 2017 at 9:57pm   •   4 replies  •  0 likes
airs-inc

Hi ,


I have integrated the JavaScript SDK for do call and SMS. Currently my application is in production mode.


My question is, How to check my history of created call and SMS using the SDK?


Thank You!

4 Answers
answered on Aug 30, 2021 at 11:29am  

Create Test Data

  1. There are a few ways you can do this, but the easiest way is to put your RingCentral Soft Phone in Sandbox Mode, and then make a test call using to your RingCentral Soft Phone from an outside number.

  2. Make sure to record one of these calls by pressing the Record button in the soft phone and ensuring the call lasts for at least 30-60 seconds, then click the Record button again to stop the recording.

  3. Now, make two more outbound calls from your RingCentral Soft Phone (making sure to adjust the settings of the SoftPhone Calling set to Direct Dial instead of RingOut. (this generates calls with a single leg)

Retrieve Call Log Data via the API

Now check that the call records exist in the API, first fetch an access_token for the User you used to initiate the above calls.

GET /restapi/v1.0/account/~/extension/~/call-log HTTP/1.1
Host: platform.ringcentral.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer REPLACE_WITH_YOUR_VALID_ACCESS_TOKEN 

We should now have a list of call records. If you followed steps 1 through 3 above you should see these records specifically. You should observe:

  • The legs for multi-legged calls are missing.
  • We can see the three different recordings, but one of these calls was made to a call group from an outside line.
{
         "uri": "https://platform.ringcentral.com/restapi/..snip..&page=1&perPage=100",    "records": [        {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../ASaxDDkSZ5s42MA?view=Simple",            "id": "ASaxDDkSZ5s42MA",            "sessionId": "13916417004",            "startTime": "2016-06-06T23:07:20.000Z",            "duration": 55,            "type": "Voice",            "direction": "Inbound",            "action": "Phone Call",            "result": "Accepted",            "to": {
                     "phoneNumber": "+15625555778",                "name": "SDK Engineer Candidate"            },            "from": {
                     "phoneNumber": "+14155555908",                "name": "SAN FRANCSCO CA",                "location": "San Francisco (South), CA"            },            "recording": {
                     "uri": "https://platform.ringcentral.com/restapi/..snip../recording/1662272004",                "id": "1662272004",                "type": "OnDemand",                "contentUri": "https://media.ringcentral.com:443/restapi/..snip../recording/1662272004/content"            }        },        {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../ASaoSC9FIMaOF24?view=Simple",            "id": "ASaoSC9FIMaOF24",            "sessionId": "13914800004",            "startTime": "2016-06-06T18:12:30.000Z",            "duration": 55,            "type": "Voice",            "direction": "Outbound",            "action": "VoIP Call",            "result": "Call connected",            "to": {
                     "phoneNumber": "+14155555908",                "location": "San Francisco (South), CA"            },            "from": {
                     "phoneNumber": "+16505556100",                "name": "SDK Engineer Candidate"            },            "recording": {
                     "uri": "https://platform.ringcentral.com/restapi/..snip../1659910004",                "id": "1659910004",                "type": "OnDemand",                "contentUri": "https://media.ringcentral.com:443/restapi/..snip../1659910004/content"            }        },        {
                 "uri": "https://platform.devtest.ringcentral.com/restapi/..snip..?view=Simple",            "id": "ASaoLzRiqjLaFYU",            "sessionId": "13914782004",            "startTime": "2016-06-06T18:07:41.000Z",            "duration": 64,            "type": "Voice",            "direction": "Outbound",            "action": "VoIP Call",            "result": "Call connected",            "to": {
                     "phoneNumber": "+14155555908",                "location": "San Francisco (South), CA"            },            "from": {
                     "phoneNumber": "+16505556100",                "name": "SDK Engineer Candidate"            },            "recording": {
                     "uri": "https://platform.ringcentral.com/restapi/..snip../1659903004",                "id": "1659903004",                "type": "OnDemand",                "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"            }        }    ],    "paging": {
             "page": 1,        "perPage": 100,        "pageStart": 0,        "pageEnd": 2    },    "navigation": {
             "firstPage": {
                 "uri": "https://platform.ringcentral.com/restapi/..snip..&page=1&perPage=100"        }    }
}

Filtering by a Time Range

If you already have plenty of call log data to sample from, you can scope the request to an appropriate time range by adding the dateTo and dateFrom query parameters (remember, ISO 8601 formatted and URL Encoded strings).

GET /restapi/v1.0/account/~/extension/~/call-log?dateFrom=DATE&dateTo=DATE HTTP/1.1
Host: platform.ringcentral.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer REPLACE_WITH_YOUR_VALID_ACCESS_TOKEN 

Retrieve Detailed Call Log Data

Fetch the list of "Detailed" call logs so we can inspect the Detailed records. We do this by adding the view query paremter and setting it equal to Detailed.

GET /restapi/v1.0/account/~/extension/~/call-log?view=Detailed HTTP/1.1
Host: platform.devtest.ringcentral.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer REPLACE_WITH_YOUR_VALID_ACCESS_TOKEN 

If everything worked, we should receive an HTTP 200 response with the JSON body which contain the legs property. Specifically, for the most recent item in the list which was used to make an inbound call to a Call Group, we can see the second leg being connected from the outside line to the Call Group main number:

{
         "uri": "https://platform.ringcentral.com/restapi/..snip../call-log?..snip..&perPage=100",    "records": [        {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../ASaxDDkSZ5s42MA?view=Detailed",            "id": "ASaxDDkSZ5s42MA",            "sessionId": "13916417004",            "startTime": "2016-06-06T23:07:20.000Z",            "duration": 55,            "type": "Voice",            "direction": "Inbound",            "action": "Phone Call",            "result": "Accepted",            "to": {
                     "phoneNumber": "+15625555778",                "name": "SDK Engineer Candidate"            },            "from": {
                     "phoneNumber": "+14155555908",                "name": "SAN FRANCSCO CA",                "location": "San Francisco (South), CA"            },            "recording": {
                     "uri": "https://platform.ringcentral.com/restapi/..snip../1662272004",                "id": "1662272004",                "type": "OnDemand",                "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"            },            "transport": "PSTN",            "lastModifiedTime": "2016-06-06T23:08:23.336Z",            "legs": [                {
                         "startTime": "2016-06-06T23:07:20.000Z",                    "duration": 55,                    "type": "Voice",                    "direction": "Inbound",                    "action": "Phone Call",                    "result": "Accepted",                    "to": {
                             "phoneNumber": "+15625555778",                        "name": "SDK Engineer Candidate"                    },                    "from": {
                             "phoneNumber": "+14155555908",                        "name": "SAN FRANCSCO CA",                        "location": "San Francisco (South), CA"                    },                    "recording": {
                             "uri": "https://platform.ringcentral.com/restapi/..snip../1662272004",                        "id": "1662272004",                        "type": "OnDemand",                        "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"                    },                    "transport": "PSTN",                    "legType": "Accept",                    "extension": {
                             "uri": "https://platform.ringcentral.com/restapi/..snip../664573005",                        "id": 664573005                    }                },                {
                         "startTime": "2016-06-06T23:07:20.000Z",                    "duration": 55,                    "type": "Voice",                    "direction": "Outbound",                    "action": "VoIP Call",                    "result": "Accepted",                    "to": {
                             "phoneNumber": "+16505559233",                        "location": "San Mateo, CA"                    },                    "from": {
                             "phoneNumber": "+14155555908",                        "name": "SDK Engineer Candidate"                    },                    "recording": {
                             "uri": "https://platform.ringcentral.com/restapi/..snip../1662272004",                        "id": "1662272004",                        "type": "OnDemand",                        "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"                    },                    "transport": "VoIP",                    "legType": "PstnToSip",                    "extension": {
                             "uri": "https://platform.ringcentral.com/restapi/..snip../664573005",                        "id": 664573005                    }                }            ]        },        {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../ASaoSC9FIMaOF24?view=Detailed",            "id": "ASaoSC9FIMaOF24",            "sessionId": "13914800004",            "startTime": "2016-06-06T18:12:30.000Z",            "duration": 55,            "type": "Voice",            "direction": "Outbound",            "action": "VoIP Call",            "result": "Call connected",            "to": {
                     "phoneNumber": "+14155555908",                "location": "San Francisco (South), CA"            },            "from": {
                     "phoneNumber": "+16505556100",                "name": "SDK Engineer Candidate"            },            "recording": {
                     "uri": "https://platform.ringcentral.com/restapi/..snip../1659910004",                "id": "1659910004",                "type": "OnDemand",                "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"            },            "transport": "VoIP",            "lastModifiedTime": "2016-06-06T18:13:43.335Z",            "legs": [                {
                         "startTime": "2016-06-06T18:12:30.000Z",                    "duration": 55,                    "type": "Voice",                    "direction": "Outbound",                    "action": "VoIP Call",                    "result": "Call connected",                    "to": {
                             "phoneNumber": "+14155555908",                        "location": "San Francisco (South), CA"                    },                    "from": {
                             "phoneNumber": "+16505556100",                        "name": "SDK Engineer Candidate"                    },                    "recording": {
                             "uri": "https://platform.ringcentral.com/restapi/..snip../1659910004",                        "id": "1659910004",                        "type": "OnDemand",                        "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"                    },                    "transport": "VoIP",                    "legType": "SipToPstnUnmetered",                    "extension": {
                             "uri": "https://platform.ringcentral.com/restapi/..snip../664573005",                        "id": 664573005                    }                }            ]        },        {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../ASaoLzRiqjLaFYU?view=Detailed",            "id": "ASaoLzRiqjLaFYU",            "sessionId": "13914782004",            "startTime": "2016-06-06T18:07:41.000Z",            "duration": 64,            "type": "Voice",            "direction": "Outbound",            "action": "VoIP Call",            "result": "Call connected",            "to": {
                     "phoneNumber": "+14155555908",                "location": "San Francisco (South), CA"            },            "from": {
                     "phoneNumber": "+16505556100",                "name": "SDK Engineer Candidate"            },            "recording": {
                     "uri": "https://platform.ringcentral.com/restapi/..snip../recording/1659903004",                "id": "1659903004",                "type": "OnDemand",                "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"            },            "transport": "VoIP",            "lastModifiedTime": "2016-06-06T18:09:03.334Z",            "legs": [                {
                         "startTime": "2016-06-06T18:07:41.000Z",                    "duration": 64,                    "type": "Voice",                    "direction": "Outbound",                    "action": "VoIP Call",                    "result": "Call connected",                    "to": {
                             "phoneNumber": "+14155555908",                        "location": "San Francisco (South), CA"                    },                    "from": {
                             "phoneNumber": "+16505556100",                        "name": "SDK Engineer Candidate"                    },                    "recording": {
                             "uri": "https://platform.ringcentral.com/restapi/..snip../1659903004",                        "id": "1659903004",                        "type": "OnDemand",                        "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"                    },                    "transport": "VoIP",                    "legType": "SipToPstnUnmetered",                    "extension": {
                             "uri": "https://platform.ringcentral.com/restapi/..snip../664573005",                        "id": 664573005                    }                }            ]        }    ],    "paging": {
             "page": 1,        "perPage": 100,        "pageStart": 0,        "pageEnd": 2    },    "navigation": {
             "firstPage": {
                 "uri": "https://platform.ringcentral.com/restapi/..snip..&page=1&perPage=100"        }    }
}

Congdon and Coleman Real Estate offers world-class realtor services for vacation rentals

Inspecting Multi-Leg Calls

Inspecting the legs property of the multi-leg call, we can see two different legType properties, the most recent (legs[0]) was the Accept which occurred when the call was accepted on your SoftPhone, while the former (legs[1]) was the PstnToSip which occurred when the inbound call from my celluar device was pointed by RingCentral to the IVR setup within my account. The from.name property would not make sense if you were to neglect looking at the call legType.

"legs": [    {
             "startTime": "2016-06-06T23:07:20.000Z",        "duration": 55,        "type": "Voice",        "direction": "Inbound",        "action": "Phone Call",        "result": "Accepted",        "to": {
                 "phoneNumber": "+15625555778", // The direct number of the Call Group defined in RingCentral            "name": "SDK Engineer Candidate" // Name of the Extension that handled the call        },        "from": {
                 "phoneNumber": "+14155555908",            "name": "SAN FRANCSCO CA",            "location": "San Francisco (South), CA"        },        "recording": {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../recording/1662272004",            "id": "1662272004",            "type": "OnDemand",            "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"        },        "transport": "PSTN",        "legType": "Accept",        "extension": {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../664573005",            "id": 664573005        }    },    {
             "startTime": "2016-06-06T23:07:20.000Z",        "duration": 55,        "type": "Voice",        "direction": "Outbound",        "action": "VoIP Call",        "result": "Accepted",        "to": {
                 "phoneNumber": "+16505559233",            "location": "San Mateo, CA"        },        "from": {
                 "phoneNumber": "+14155555908",            "name": "SDK Engineer Candidate"        },        "recording": {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../1662272004",            "id": "1662272004",            "type": "OnDemand",            "contentUri": "https://media.ringcentral.com:443/restapi/..snip../content"        },        "transport": "VoIP",        "legType": "PstnToSip",        "extension": {
                 "uri": "https://platform.ringcentral.com/restapi/..snip../664573005",            "id": 664573005        }    }
]

 0
answered on Jul 11, 2019 at 12:37pm  

 0
answered on Jul 7, 2019 at 8:34am  

Call Log is one of the the way to check the history

https://developers.ringcentral.com/api-reference

Check the Navigation bar is on the top of RingCentral App. Press the forth icon (gear) and go to Settings.
Scroll down to the third section which title is "Logs"


 0
answered on Sep 13, 2017 at 10:53pm  
Here is the API reference: https://developer.ringcentral.com/api-docs/latest/index.html

You can find the endpoints to check call and sms history in the "Call Log" and "Messages" sections.

 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