question

vadim-soluyanov6963 avatar image
vadim-soluyanov6963 asked Tyler Liu commented

Call Log. No Recordings parameter

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?

call 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.

Tyler Liu avatar image
Tyler Liu answered
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.
1 |3000

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

vadim-soluyanov6963 avatar image
vadim-soluyanov6963 answered
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 ?




1 |3000

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

Tyler Liu avatar image
Tyler Liu answered
1 |3000

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

vadim-soluyanov6963 avatar image
vadim-soluyanov6963 answered
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"
}



1 |3000

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

Tyler Liu avatar image
Tyler Liu answered Tyler Liu commented
Are you sending "true" as string or boolean?
15 comments
1 |3000

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

vadim-soluyanov6963 avatar image vadim-soluyanov6963 commented ·
Now I'll try to send as a string


1 Like 1 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
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.
1 Like 1 ·
vadim-soluyanov6963 avatar image vadim-soluyanov6963 commented ·
Boolean
0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
Could you please post your code ? The part you used to fetch call logs.
0 Likes 0 ·
vadim-soluyanov6963 avatar image vadim-soluyanov6963 commented ·
$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



0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
I am wondering why "[withRecording] => 1" instead of "[withRecording] => true"
0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
Is it auto converted by PHP?
0 Likes 0 ·
vadim-soluyanov6963 avatar image vadim-soluyanov6963 commented ·
Yes.
0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
I think it is a good idea.
0 Likes 0 ·
vadim-soluyanov6963 avatar image vadim-soluyanov6963 commented ·
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


0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
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.
0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
 
0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
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.
0 Likes 0 ·
vadim-soluyanov6963 avatar image vadim-soluyanov6963 commented ·
Thank you very match, Tayler Long! Everything worked!!! :)


0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
You are welcome!
0 Likes 0 ·

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