Skip to main content
Question

Call Log API Call always Empty

  • February 23, 2023
  • 2 replies
  • 315 views

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))

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • February 23, 2023

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)

  • Author
  • New Participant
  • February 23, 2023

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.