question

Arron Voce avatar image
Arron Voce asked Phong Vu answered

Python Call Log

Hi, I have a working python script that pulls the call log from RC which runs every 15 mins and sends it to a database however the problem is that it re-downloads the entire call log every time.


I need the script to check for only new records, how do I do this?

call logpython
1 |1500 characters needed characters left characters exceeded

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

You can use the "dateFrom" and "dateTo" to keep track of the logs (within the specified date/time period) you have downloaded.

now = time.time()
less15Mins = now - (60 * 15)

dateFrom = datetime.utcfromtimestamp(less15Mins).strftime('%Y-%m-%dT%H:%M:%S.000Z'
params = {
    'dateFrom': dateFrom,
    'perPage': 1000
}

Every time you read 15 mins backward from the current time.

1 |1500 characters needed characters left characters exceeded

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

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