question

Joshua Noble avatar image
Joshua Noble asked Joshua Noble commented

Call Log API Call always Empty

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))
rest apicall logs
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered Joshua Noble commented

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)
1 comment
1 |3000

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

Joshua Noble avatar image Joshua Noble commented ·

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.

1 Like 1 ·

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