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
Call Log API Call always Empty
Tags: call logs, rest api
Feb 23, 2023 at 8:10am   •   1 replies  •  0 likes
Joshua Noble

Hi Team, I'm calling the Call Log API using the code snippet below from both a Sandbox environment and a Live environment (one of our customers), and the Call Log that is created from this always shows up with empty data. Both the Sandbox and Live environment have information in their Call Log confirmed. What needs to be done to pull the full data of the call log?

from ringcentral import SDK
 
RINGCENTRAL_CLIENTID = '[INSERT]'
RINGCENTRAL_CLIENTSECRET = '[INSERT]'
RINGCENTRAL_SERVER = '[INSERT]'
 
rcsdk = SDK( RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER)
platform = rcsdk.platform()
 
JWT_TOKEN = "[INSERT]"

try:
    platform.login( jwt=JWT_TOKEN )
    params = {
        'dateFrom': "2012-01-01T00:00:00.000Z"
        }
    resp = platform.get('/restapi/v1.0/account/~/extension/~/call-log', params)
    for record in resp.json().records:
        print ("Call type: " + record.type)
except Exception as e:
    print ("Unable to authenticate to platform. Check credentials." + str(e))
1 Answer
answered on Feb 23, 2023 at 8:48am  

First of all, be relevant with the date/time range. Change it to a recent date or at least the date the account was created.

params = {
        'dateFrom': "2012-01-01T00:00:00.000Z"
        }

In your code, you are reading a user extension call log, are you sure that that user has call log data which you saw from their service web or some where as you wrote "Both the Sandbox and Live environment have information in their Call Log confirmed."

If you are not sure which user has call log data, create a JWT token from a user who has the super admin role, then call this endpoint

resp = platform.get('/restapi/v1.0/account/~/call-log', params)

 0
on Feb 23, 2023 at 9:39am   •  1 likes

Thanks, Phong. I have a feeling the extension piece is likely the culprit. I've requested out client update the date and response request. I will update and mark the answer appropriately once I'm able to confirm.



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