ak avatar image
ak asked

How do we identify which Extension picked up the Call through our API ?

One of our Developer has a question on :

Every inbound call has many legs for the different extensions, which is normal. problem is that there's no way for me to know who actually spoke to the customer!


Typically with a Call-Centre type application, where we have many extensions/users associated with the Main Company Number. How is it possible to identify which Extension/User answered the call.


Let's say a Customer calling in the Main Company Number is redirected to a particular extension using the IVR . The Service Web would display the Call-Legs associated with the call in the "Detailed" view section of the Call-Logs but how do i see them via API response.


To match the Account level Call-Log records to specific extension/user call-log entries to identify the user who picked up the call


In-order to identify the extension who picked up the call you would need to retrieve the Account Call-Logs :

API Endpoint : /v1.0/account/{accountId}/call-log

Parameters : 'view' = 'Detailed'

An example of the API response containing the legs would be as below :

"legs": [
                "startTime": "2016-05-13T18:13:20.000Z",
                "duration": 53,
                "type": "Voice",
                "direction": "Inbound",
                "action": "Phone Call",
                "result": "Accepted",
                "to": {
                    "phoneNumber": "+11234567890",
                    "name": "Sample Digital Line Only"
                "from": {
                    "phoneNumber": "+11212121212",
                    "name": "Sample Company Number",
                    "location": "Millbrae, CA"
                "transport": "PSTN",
                "legType": "Accept",
                "extension": {
                    "uri": "https:\/\/\/restapi\/v1.0\/account\/665427020\/extension\/734191020",
                    "id": 734191020

For more information on the Account level Call Log Endpoint, please take a look at our API Explorer :!/Call_Log/loadExtensionCallLog

Please be reminded the endpoint would be/v1.0/account/{accountId}/call-log

From above the Account level Call-Logs would return the legs within the Detailed view which would contain the "to" information about the extension which picked up the Call.

At the moment, our API response would contain the name of the extension who picked up the call using which we could map it to the extension number ( the extension number ( xxx - xxxxx ) assigned to the extension.

The name parameter returned in the API response is the 'First Name' + space + 'Last Name' which is assigned to the extension in the Service Web ( )

name = ( string ) 'First Name' + space + 'Last Name'

Take a look at our tutorial on adding / creating extensions :


So in order to implement this solution, your application would need to have a mapping of the extensions name to an extension number.

Consider an extension 102 with the details as below :

Extension Number : 102

First Name : John

Last Name : Petrucci

So you can create a mapping which could be a key-value pair matching of :

"Key" : "John" + " " + "Petrucci"
"value" : "102"


API Explorer :

API Developer Guide :

If you have any questions or concerns and would like to address any issue with our support team, you could alternatively open a support case with ""

getting started
1 |3000

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

0 Answers

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