Call Log. No Recordings parameter

  • 1
  • Problem
  • Updated 8 months ago
When I receive a
call log, the call record option is not returned, although in the Ringcentral desktop application I press the "Record Call" button and then I see this record and can listen, but through the API, when I receive the array, there is no recordings parameter. How to get a link to record a call via API?
Photo of Vadim Soluyanov

Vadim Soluyanov

  • 176 Points 100 badge 2x thumb

Posted 8 months ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
Here is sample code for call recording download: https://github.com/ringcentral/ringcentral-csharp-client/blob/master/RingCentral.Test/BinaryTest.cs#...

In the body of a call log record, there is a recording property where you can fetch information about it especially its ID.
Photo of Vadim Soluyanov

Vadim Soluyanov

  • 176 Points 100 badge 2x thumb
In the request, I send the parameters /account/'.$accountId.'/extension/'.$extensionId.'/call-log and get an array in response, but there is no recording property. Do I need to specify some additional parameter in my case to get this property. Maybe something has changed in the API ?




Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
Photo of Vadim Soluyanov

Vadim Soluyanov

  • 176 Points 100 badge 2x thumb
This parameter causes an error in my case:

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



(Edited)
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
Are you sending "true" as string or boolean?
(Edited)
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
Could you please post your code ? The part you used to fetch call logs.
Photo of Vadim Soluyanov

Vadim Soluyanov

  • 176 Points 100 badge 2x thumb
$useSessionId = ($callInfo['CALL_TYPE']=='IN') ? $callInfo['IN_SESSION_ID'] : $callInfo['OUT_SESSION_ID'];
            $extensionId = $callInfo['EXTENSION_ID'];
            $params = array(
                'sessionId' => $useSessionId,
                'withRecording' => true,
            );
            $result = $rcApi->getCallLog('~', $extensionId, $params);

and call method

public function getCallLog($accountId, $extensionId, $queryParameters=array(), $headers=array()) {
        $path = '/account/'.$accountId.'/extension/'.$extensionId.'/call-log';
        $group = $this->getRateGroup();
        $this->setRateGroup('HEAVY');
        $result = $this->get($path, $queryParameters, $headers);
        $this->setRateGroup($group);

        return $result;
    }

and reply from RC Rest

mess:
                Method: GET
                Url: /account/~/extension/191668004/call-log
                Query: Array
(
    [sessionId] => 19567570004
    [withRecording] => 1
)

                Body:
                Headers: Array
(
    [Authorization] => Bearer U0pDMTFQMDFQQVMwMHxBQURiLXVmTnllUVc5d0xHQXFxX0htQVNpTndrT1dwbEpGZEV1aE9uRnFLY2MwZVdJd1hBQVF6WVdZT0JNc0diT29ONF9QWWRPMEVYNENYQjd4dmJsWHJoRktleW5VM2RmZ1U4RWFEc3FFZ0lVTV9iZzFOUHQ4eXozNExlYjJuSG01S0J3SGwzUU5rWThxYXlNaGVXOUNYYW5zLTBJX2hkbjB3MG5rU2ozWk9MMHpCeGlDQl9SbTlnU09DcEpIREZyWmZQWVZrVTZydC1tZjFuOTlZeU5hekl8QVlacUJRfFZPdlozSHdTaXpTMk9pYVFzb0l1UkF8QUE
    [Accept] => application/json
)

                Result: {
  "errorCode" : "InvalidParameter",
  "message" : "Parameter [withRecording] value is invalid",
  "errors" : [ {
    "errorCode" : "CMN-101",
    "message" : "Parameter [withRecording] value is invalid",
    "parameterName" : "withRecording"
  } ],
  "parameterName" : "withRecording"
}
                Curl error code: 0



Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
I am wondering why "[withRecording] => 1" instead of "[withRecording] => true"
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
Is it auto converted by PHP?
Photo of Vadim Soluyanov

Vadim Soluyanov

  • 176 Points 100 badge 2x thumb
Now I'll try to send as a string


Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
I think it is a good idea.
Photo of Vadim Soluyanov

Vadim Soluyanov

  • 176 Points 100 badge 2x thumb
I sent a query with three as a string, the error is now another

mess:
                Method: GET
                Url: /account/~/extension/191668004/call-log
                Query: Array
(
    [sessionId] => 19568490004
    [withRecording] => true
)

                Body:
                Headers: Array
(
    [Authorization] => Bearer U0pDMTFQMDFQQVMwMHxBQURiLXVmTnllUVc5d0xHQXFxX0htQVNpTndrT1dwbEpGZEV1aE9uRnFLY2MwZVdJd1hBQVF6WVdZT0JNc0diT29ONF9QWWRPMEVYNENYQjd4dmJsWHJoeUhFcTZMankzR284RWFEc3FFZ0lVREEzQjFmOGtwLVhrSnlWd3M3RnRzdUFHamtHQXoxc0VtNkU0eFVyRGVpemlHekxzWWZTSktZMG5rU2ozWk9MMDhBcGhjYUNPWUVnU09DcEpIREZyWmV3WDRaelNhM2dFWG52cG5sZlpfV1l8QVlacUJRfEZRMHN3V0pab1ZrajM1T3JnRXZFOFF8QUE
    [Accept] => application/json
)

                Result: {
  "errorCode" : "InvalidParameter",
  "message" : "Parameter [sessionId] is not allowed for usage along with parameter [withRecording]",
  "errors" : [ {
    "errorCode" : "CLG-110",
    "message" : "Parameter [sessionId] is not allowed for usage along with parameter [withRecording]",
    "parameterName" : "withRecording"
  } ],
  "parameterName" : "withRecording"
}
                Curl error code: 0


Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
I think you can remove "sessionId" from query parameters. Try other parameters to filter the call logs. And you can also filter the call logs on client side instead of server side.
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
 
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
https://developer.ringcentral.com/api-docs/latest/index.html#!#RefGetUserCallLog

I mislead you. According to the doc, you should use "recordingType".

And if there is no result returned, it simply means the call was not recorded.
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
And don't forget "view=Detailed"

 https://github.com/ringcentral/ringcentral-csharp-client/blob/master/RingCentral.Test/BinaryTest.cs#...

I believe you can translate the C# code to PHP. I am sure the C# code works.
(Edited)
Photo of Vadim Soluyanov

Vadim Soluyanov

  • 176 Points 100 badge 2x thumb
Thank you very match, Tayler Long! Everything worked!!! :)


Photo of Tyler Long

Tyler Long, Official Rep

  • 9,828 Points 5k badge 2x thumb
You are welcome!