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 to read all users call logs at once?
Tags: sdk
Sep 5, 2018 at 10:39pm   •   2 replies  •  0 likes
scott-rister

I am working on to access RingCentral Call Reports using API access.


Our requirement is to fetch the Outbound call logs of all the users (Company Call Logs) registered under my organization, at once.


The API documentation states that to fetch the call logs of all the users at once, we have an account call log API, i.e., '/account/~/call-log' and we are trying to access the same.

What we need are the exact equivalent records that we get using "Analytics Portal" under "Reports" menu of "RingCentral Admin Account".

Below is the Request URL that we have been accessing to fetch the records:

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/call-log?direction=Outbound&type=Voice&view=Detailed&dateFrom=2018-08-01&dateTo=2018-08-30&page=1&perPage=100

When we generate the analytical reports from Admin portal, it shows thousands of outbound calls made by the company's agents and when we hit the above request URL it gives an empty response. We have tried the same from the available "API Explorer" in the developer's account and still, no data got loaded.


Please do suggest if we are missing something in the process or if there needs to be something activated from RingCentral portal? Or if there is any other way to track the call activity of the employees using API access?




2 Answers
answered on Sep 20, 2018 at 12:57am  
Phong,

I'm having this strange case. Please see below:

I fetched the records for the Extn. 33345 (The extn. is associated to Peter Burke) for the date 2018-09-19. From my admin panel of RC, I used the filters and it showed me aroung 20 records or so as the outbound calls that were made on the mentioned date. But when I use the API, the results are different entirely. Have a look:

CASE 1: (Extension Level)
--------------------------------------------------------------------------
Request URL:
https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/call-log?extensionNumber=33345&a...:
Response:<br>{   "uri": "https://platform.ringcentral.com/restapi/v1.0/account/214632031/extension/214632031/call-log?view=Simple&extensionNumber=33345&type=Voice&direction=Outbound&showBlocked=true&withRecording=false&dateFrom=2018-09-19T00:00:00.000Z&dateTo=2018-09-19T23:59:59.000Z&page=1&perPage=100",   "records": [],   "paging": {     "page": 1,     "perPage": 100   },   "navigation": {     "firstPage": {       "uri": "https://platform.ringcentral.com/restapi/v1.0/account/214632031/extension/214632031/call-log?view=Simple&extensionNumber=33345&type=Voice&direction=Outbound&showBlocked=true&withRecording=false&dateFrom=2018-09-19T00:00:00.000Z&dateTo=2018-09-19T23:59:59.000Z&page=1&perPage=100"     },     "lastPage": {       "uri": "https://platform.ringcentral.com/restapi/v1.0/account/214632031/extension/214632031/call-log?view=Simple&extensionNumber=33345&type=Voice&direction=Outbound&showBlocked=true&withRecording=false&dateFrom=2018-09-19T00:00:00.000Z&dateTo=2018-09-19T23:59:59.000Z&page=1&perPage=100"     }   } }

CASE 2: (Account Level)
---------------------------------------------------------------------
Request URL:
https://platform.ringcentral.com/restapi/v1.0/account/~/call-log?extensionNumber=33345&direction...:
Response:<br>{   "uri": "https://platform.ringcentral.com/restapi/v1.0/account/214632031/call-log?view=Simple&extensionNumber=33345&type=Voice&direction=Outbound&showBlocked=true&withRecording=false&dateFrom=2018-09-19T00:00:00.000Z&dateTo=2018-09-19T23:59:59.000Z&page=1&perPage=100",   "records": [     {       "uri": "https://platform.ringcentral.com/restapi/v1.0/account/214632031/call-log/LMQu3tU8kmTBjUA?view=Simple",       "id": "LMQu3tU8kmTBjUA",       "sessionId": "541191845007",       "startTime": "2018-09-19T14:34:57.773Z",       "duration": 94,       "type": "Voice",       "direction": "Outbound",       "action": "VoIP Call",       "result": "Call connected",       "to": {         "phoneNumber": "+19133345670",         "location": "Bethel, KS"       },       "from": {         "phoneNumber": "+19724136243",         "name": "Neil Caffery"       },       "extension": {         "uri": "https://platform.ringcentral.com/restapi/v1.0/account/214632031/extension/165831030",         "id": 165831030       }     }   ],   "paging": {     "page": 1,     "perPage": 100,     "pageStart": 0,     "pageEnd": 0   },   "navigation": {     "firstPage": {       "uri": "https://platform.ringcentral.com/restapi/v1.0/account/214632031/call-log?view=Simple&extensionNumber=33345&type=Voice&direction=Outbound&showBlocked=true&withRecording=false&dateFrom=2018-09-19T00:00:00.000Z&dateTo=2018-09-19T23:59:59.000Z&page=1&perPage=100"     },     "lastPage": {       "uri": "https://platform.ringcentral.com/restapi/v1.0/account/214632031/call-log?view=Simple&extensionNumber=33345&type=Voice&direction=Outbound&showBlocked=true&withRecording=false&dateFrom=2018-09-19T00:00:00.000Z&dateTo=2018-09-19T23:59:59.000Z&page=1&perPage=100"     }   } }
How are these hits giving me different records for the same extension? Also, the record that the "Case 2 (Account Level)" API returned me lists some other agent name and phone number in "from.name" and "from.phoneNumber". How is this possible?

After seeing this I looked into other returned results that I was getting and yes, the API response data don't match with the records that I get from my Admin panel from RC under "Call Log" heading.

Please help me in understanding this here.


 0
answered on Sep 7, 2018 at 11:22am  
Hi Scott,

That sounds a very simple feature and doable with the Company Call Log API. What I see from the Request URL above is the "devtest" environment. When you said that you access your company call log via the "Analytics Portal", is that your on real (production) account? If that is your production account then the request url above is pointing to a different account, which is your sandbox account and that could be the reason why you don't see any call log. If that is the case, then just remove the "devtest" from the request URL and try again.

If you want to see a useful demo/tutorial about how to access the call log, read data and visualize the data, please read this blog and learn more from the step-by-step tutorial.

Blog: https://medium.com/ringcentral-developers/visualize-your-business-communications-history-2c81f85c324...
Tutorial: https://ringcentral-tutorials.github.io/calllog-visualization-nodejs-demo/?distinctId=1398916020

Hoe this helps and let me know if you still have any problem with RingCentral platform.

+ Phong

 0



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