Overview of the RingCentral Call Log API

Last updated: 2022-02-01 Contributors Byrne ReesePaco VuNone
Edit this page

RingCentral's Call Log is one of the platform's most utilized resources as it enables many different use cases important to enterprises and businesses. Developers use RingCentral's Call Log for the following use cases:

  • Archive and/or download call log data to an external system - Since RingCentral does not store Call Log data indefinitely, developers use the Call Log API to download Call Log data into customer-owned, long-term, persistent storage.

  • Reporting and analytics - Developers use the Call Log API to analyze call histories, agent performance, answer rates, and more - with a desire and intent to improve company operations and performance. Developers may also consider using the Analytics API to access aggregated data about an organizations call history.

  • Integration with third-party services, especially CRMs - Developers can use Call Log data to help augment 3rd party systems with customer interaction histories and more.

  • Billing Systems - Service industries often need to bill customers based on the time spent serving them over the phone. Call Log data catalogs all time spent with customers to make time tracking easier.

Call Log Anti-Patterns

Here are ways developers should not use the Call Log API:

  • Real-time reporting - The Call Log API resource is labeled as a "Heavy" usage plan. RingCentral offers better solutions for event-driven, real-time reporting for RingCentral Extensions, primarily Webhooks and/or Push Notifications.
  • Long-Polling - While this is highly related to the above, it is important to clearly note that long-polling Call Log (executing multiple HTTP requests to simulate real-time, socket-based data) is not a supported use case.

How long does it take for the call log to be updated?

It can take anywhere between 15-30 seconds for a completed phone call to appear in the call log. Developers who need more real-time access to events that may relate to or impact a company's call log can look to one of the following solutions:

  • The Active Call API is an alternative API to help developers find calls that are currently in process. The Active Call API is not a real-time API, however, but it can be a more expedient way to find calls in progress.
  • The Account Telephony Sessions event is an event that is triggered whenever the state of a call is changed. This is a more reliably real-time event for determining when calls begin and end.
  • The Extension Telephony Sessions event is similar to the Account Telephony Sessions event, but is scoped to a specific user or extension.

Get started with the Call Log API

const RC = require('@ringcentral/sdk').SDK
require('dotenv').config();

CLIENTID     = process.env.RC_CLIENT_ID
CLIENTSECRET = process.env.RC_CLIENT_SECRET
SERVER       = process.env.RC_SERVER_URL
USERNAME     = process.env.RC_USERNAME
PASSWORD     = process.env.RC_PASSWORD
EXTENSION    = process.env.RC_EXTENSION

var rcsdk = new RC({
    server:       SERVER,
    clientId:     CLIENTID,
    clientSecret: CLIENTSECRET
});
var platform = rcsdk.platform();
platform.login({
    username:  USERNAME,
    password:  PASSWORD,
    extension: EXTENSION
})

platform.on(platform.events.loginSuccess, () => {
  read_user_calllog()
});

async function read_user_calllog() {
  try {
    var resp = await platform.get('/account/~/extension/~/call-log', {
      view: 'Detailed'
    })
    var jsonObj = await resp.json()
    for (var record of jsonObj.records)
      console.log("Call type: " + record.type)
  } catch (e) {
    console.log(e.message)
  }
}
#!/usr/bin/env python
from ringcentral import SDK
import os,sys

CLIENTID     = os.environ.get('RC_CLIENT_ID')
CLIENTSECRET = os.environ.get('RC_CLIENT_SECRET')
SERVER       = os.environ.get('RC_SERVER_URL')
USERNAME     = os.environ.get('RC_USERNAME')
PASSWORD     = os.environ.get('RC_PASSWORD')
EXTENSION    = os.environ.get('RC_EXTENSION')

rcsdk = SDK( CLIENTID, CLIENTSECRET, SERVER )
platform = rcsdk.platform()
try:
  platform.login(USERNAME, EXTENSION, PASSWORD)
except:
  sys.exit("Unable to authenticate to platform. Check credentials.")

params = {
    'view': 'Detailed'
}

resp = platform.get('/restapi/v1.0/account/~/extension/~/call-log', params)
for record in resp.json().records:
    print(f'Call type: {record.type}')
<?php
require('vendor/autoload.php');
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->load();

$CLIENTID     = $_ENV['RC_CLIENT_ID'];
$CLIENTSECRET = $_ENV['RC_CLIENT_SECRET'];
$SERVER       = $_ENV['RC_SERVER_URL'];
$USERNAME     = $_ENV['RC_USERNAME'];
$PASSWORD     = $_ENV['RC_PASSWORD'];
$EXTENSION    = $_ENV['RC_EXTENSION'];

$rcsdk = new RingCentral\SDK\SDK($CLIENTID, $CLIENTSECRET, $SERVER);
$platform = $rcsdk->platform();
$platform->login($USERNAME, $EXTENSION, $PASSWORD);

$params = array(
   'view' => 'Detailed'
    );

$resp = $platform->get('/account/~/extension/~/call-log', $params);
foreach ($resp->json()->records as $record) {
    print_r ("Call type: ".$record->type);
}
?>
using System;
using System.Threading.Tasks;
using RingCentral;

namespace Read_CallLog
{
class Program
{
        static RestClient restClient;
    static void Main(string[] args)
    {
            restClient = new RestClient(
        Environment.GetEnvironmentVariable("RC_CLIENT_ID"),
        Environment.GetEnvironmentVariable("RC_CLIENT_SECRET"),
        Environment.GetEnvironmentVariable("RC_SERVER_URL"));
            restClient.Authorize(
        Environment.GetEnvironmentVariable("RC_USERNAME"),
        Environment.GetEnvironmentVariable("RC_EXTENSION"),
        Environment.GetEnvironmentVariable("RC_PASSWORD")).Wait();
        read_user_calllog().Wait();
    }
    static private async Task read_user_calllog()
    {
        var parameters = new ReadUserCallLogParameters();
        parameters.view = "Detailed";

        var resp = await restClient.Restapi().Account().Extension().CallLog().List(parameters);
        foreach (CallLogRecord record in resp.records)
        {
            Console.WriteLine("Call type: " + record.type);
        }
    }
}
}
package com.ringcentral;

import com.ringcentral.*;
import com.ringcentral.definitions.*;
import java.io.IOException;

public class ReadCallLog {
    static RestClient rc;

    public static void main(String[] args) {
        var obj = new ReadCallLog();
    rc = new RestClient( System.getenv("RC_CLIENT_ID"),
                 System.getenv("RC_CLIENT_SECRET"),
                 System.getenv("RC_SERVER_URL") );
    try {
        rc.authorize( System.getenv("RC_USERNAME"),
              System.getenv("RC_EXTENSION"),
              System.getenv("RC_PASSWORD") );
        obj.read_user_call_log();
    } catch (RestException | IOException e) {
        e.printStackTrace();
    }
    }

    public static void read_user_call_log() throws RestException, IOException {
    ReadUserCallLogParameters parameters = new ReadUserCallLogParameters();
    parameters.view = "Detailed";
    UserCallLogResponse response = rc.restapi().account().extension().callLog().list(parameters);
    for (UserCallLogRecord record : response.records) {
        System.out.println("Call type: " + record.type);
    }
    }
}
require 'ringcentral'
require 'dotenv/load'

CLIENTID     = ENV['RC_CLIENT_ID']
CLIENTSECRET = ENV['RC_CLIENRT_SECRET']
SERVER       = ENV['RC_SERVER_URL']
USERNAME     = ENV['RC_USERNAME']
PASSWORD     = ENV['RC_PASSWORD']
EXTENSION    = ENV['RC_EXTENSION']

$rc = RingCentral.new(CLIENTID, CLIENTSECRET, SERVER)
$rc.authorize(username: USERNAME, extension: EXTENSION, password: PASSWORD)

resp = $rc.get('/restapi/v1.0/account/~/extension/~/call-log', {
    view: 'Detailed'
})

for record in resp.body['records'] do
    puts "Call type: " + record['type']
end

Call Log API Permissions

There are various API Permissions your application will be required to use depending upon the type of call log data developers need to access from the RingCentral API.

  • Active Calls, Account level Call Log Records, and Extension level Call Log Records require the ReadCallLog API permission.
  • Call Recording Metadata and Call Recording Content require the ReadCallRecording API Permission