News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
How do we identify which Extension picked up the Call through our API ?
Tags: getting started
May 13, 2016 at 12:22pm   •   0 replies  •  0 likes
ak

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!

Problem

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.


Scenario

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.


Goal

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


Solution

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:\/\/platform.ringcentral.com\/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 :


https://developer.ringcentral.com/api-explorer/latest/index.html#/!/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 ( https://service.ringcentral.com/ )


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


Take a look at our tutorial on adding / creating extensions : https://support.ringcentral.com/mvp/admin/adding-setting-up-users.html



Pre-Requisites

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"


Resources

API Explorer : https://developer.ringcentral.com/api-explorer/latest/index.html


API Developer Guide : https://developer.ringcentral.com/api-docs/latest/index.html


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 "developer.ringcentral.com"



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us