johnw
John Wang
October 12, 2015
Developers
Integrations
Telephony

RingCentral Launches Call Recording APIs to Expand Data Offerings

Call Recording APIRingCentral is excited to announce availability of its call recording streaming APIs. Call recordings are an integral part of every voice communications service and are already available from RingCentral’s mobile, desktop and web applications. This new capability extends the availability of call recordings for retrieval and streaming playback via the API to enable rich integrations to enhance the core capabilities provided by RingCentral. Popular use cases include analyzing recording voice communications to understand and enhance customer interactions, searching recordings to locate data and respond to inquiries, and general archival to enable access for future requirements.

The call recording APIs support both bulk download for archival and sync purposes as well as streaming playback such as using HTML5 audio. The call recording APIs work in conjunction with the call log API that can be used to query for and retrieve information on calls with recordings. Then the specific call recording metadata and recording files can be retrieved from the recording information in the call log records.

Third-party service providers can easily extend RingCentral’s offerings for customers by using the recently released 3-legged OAuth authorization functionality that ties in RingCentral’s user login and single sign-on capabilities.

To access the RingCentral call recording APIs, refer the RingCentral Developer Guide for the Call Log, Call Recording and Call Recording Content sections. Once you have the URLs of interest, you can use them directly against the API or using a SDK. The SDK will allow you to download the recording transparently or create a URL with an embedded OAuth access token that can be used by streaming playback solutions.

Here is a quick example using the PHP SDK after login:

$callLogRecords = $platform->get('/account/~/extension/~/call-log', array(
'type' => 'Voice',
'withRecording' => 'True'))
->json()->records;

foreach ($callLogRecords as $callLogRecord) {

$apiResponse = $platform->get($callLogRecord->recording->contentUri);

$id = $callLogRecord->recording->id;

// Save recording audio
$ext = ($apiResponse->response()->getHeader(‘Content-Type’)[0] == ‘audio/mpeg’)
? ‘mp3’ : ‘wav’;
$fp = fopen(“recording_${id}.${ext}”, ‘w’);
fwrite($fp, $apiResponse->raw());
fclose($fp);

// Save recording metadata
file_put_contents(“recording_${id}.json”, json_encode($callLogRecord));
}

If you have questions on this service, please contact us at devsupport@ringcentral.com or reach us on the Developer Community at https://devcommunity.ringcentral.com.