question

eramon27 avatar image
eramon27 asked tt2 answered

How do I retrieve the call-log content or mp3?

I'm performing a GET to /restapi/v1.0/account/{accountId}/recording/598205453028/content

and receiving a

* The requested URL returned error: 403 Forbidden

According to https://developer.ringcentral.com/api-docs/latest/index.html#!#AccessingCallLogs.html

GET/restapi/v1.0/account/{accountId}/extension/{extensionId}/call-log

is forbidden but I'm retrieving /account/{accountId}/recording/{sessionId}/content

Is anyone else trying to download the Call Log mp3s?

call logs
1 |1500 characters needed characters left characters exceeded

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

ak avatar image
ak answered

Are you trying to retrieve call recordings in Production Environment ?  If so please be aware that the Production Environment does not support accessing call recordings through API's.


1 |1500 characters needed characters left characters exceeded

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

eramon27 avatar image
eramon27 answered
If we are unable to use the API to download the recordings, what is the alternative?
1 |1500 characters needed characters left characters exceeded

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

eramon27 avatar image
eramon27 answered
function getURL($url, $login = false){
        $ch = curl_init ($url);
        
        if($login)
        {
                $poststring = 'LoginName='.$Username.
                              '&country=2'.
                              '&Password='.$Password;
                curl_setopt ($ch, CURLOPT_POST, 1);
                curl_setopt ($ch, CURLOPT_POSTFIELDS, $poststring);
        }
        
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
        curl_setopt ($ch, CURLOPT_COOKIEJAR, ' RC_Cookie.txt');
        curl_setopt ($ch, CURLOPT_COOKIEFILE, ' RC_Cookie.txt');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        $data = curl_exec ($ch);
        curl_close($ch);
        return $data;
}

$Username = '1713XXXXXXX';
$Password = 'XXX';

getURL(' https://service.ringcentral.com/login/main.asp',true);

file_put_contents('data.mp3',getURL(' https://service.ringcentral.com/mobile/media?cmd=downloadMessage&msgid='.$MessageID));
1 |1500 characters needed characters left characters exceeded

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

tt2 avatar image
tt2 answered

Dear eramon:

Currently, call recording access via our API is enabled on the sandbox for testing purposes. We are intending to release that feature later in the fall.

You are welcome to write to us and explain your use case needs by emailing the developer support team or opening a support ticket and include 'feature request - call recordings' in your subject line.

Thanks,

Teo

1 |1500 characters needed characters left characters exceeded

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

eramon27 avatar image
eramon27 answered
There's no need. I feel like the script I wrote is much better. If I were to use the API calls, I would have to throttle the amount of times I hit your servers while if I download each call recording using my script, I'm going to guess I can bypass the too many request API error and download each audio file one after the other.
1 |1500 characters needed characters left characters exceeded

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

tt2 avatar image
tt2 answered
You are actually using a method that we cannot guarantee will always work in the future.  I would encourage you to use the published API and wait for us to support it in production.

Since you are using an unsupported access method, it can be removed at any time.
1 |1500 characters needed characters left characters exceeded

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

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