How do I get call status for past calls?
I want to get the callerStatus and calleeStatus status which I see in the RingOut Status API response but I'm not sure what to use for the ringOutId in the URL path:
https://developer.ringcentral.com/api-reference#RingOut-getRingOutCallStatus
Request
GET /restapi/v1.0/account/400162076008/extension/400162076009/ring-out/Y3MxNzE4NDkyODg0NDM5MDJAMTAuNjIuMjkuMzM
Response
HTTP 200 OK
{
"uri" : "https://platform.ringcentral.com/restapi/v1.0/account/400162076008/extension/400162076009/ring-out/2",
"id" : "Y3MxNzE4NDkyODg0NDM5MDJAMTAuNjIuMjkuMzM",
"status" : {
"callStatus" : "Success",
"callerStatus" : "Success",
"calleeStatus" : "Success"
}
}
When making a RingOut Status call without a ringOutId, I was hoping to get a list of calls, but I get the following error instead:
Resource for parameter [ringOutId] is not found
What do I use for ringOutId? How can I get the callerStatus and calleeStatus for calls?
RingOut Active Call Status
The RingOut Status API is only used when making phone calls via RingOut. The
ringOutIdis returned in the response for the Make RingOut API. It also only returns status while the call is in progress and a short time later, after which, it will return a 404.API Ref: https://developer.ringcentral.com/api-reference#RingOut-makeRingOutCall
RingOut Historical Call Status
To get call status for historical calls, use the Call Log API. By default, the service will return status for the overall call in the
resultproperty. To get status on individual parties on the call, known as legs, use the Detailed Call Log API. The following URLs are available:Company Call Log (all users)
https://developer.ringcentral.com/api-reference#Call-Log-loadCompanyCallLog
User Extension Call Log
https://developer.ringcentral.com/api-reference#Call-Log-loadUserCallLog
With the detailed view, you will receive a response with the
legsproperty, which is an array of call log records also known as a Call Detail Records (CDR). An example record is shown below. Each call in thelegsarray has aresultproperty.resultis used instead of status because the call log only lists completed calls. Each leg has alegTypeproperty that can be used to identify the caller and callee.For example,
legTypecan be set to:RingOutClientToCallerRingOutClientToSubscriberRingOutClientToSubscribercan be used for thecalleeStatus. This gives us:callerStatus=leg.resultwhereleg.legType == 'RingOutClientToCaller'calleeStatus=leg.resultwhereleg.legType == 'RingOutClientToSubscriber'Here's a response call log record example: