This is a demo application showing how to use RingCentral API Call Log resource via the JS SDK to download call logs for your account. This application will GET all the n your RingCentral account (based on the environment, but defaults to Sandbox) and will convert the call log JSON data (once all data is fetched) into a .csv file and save locally.
This is only a demo application to show how to use Call Logs API resource properly with the RingCentral-JS SDK. This code should not be used directly in production, but can be used for PoC development and testing.
- Valid RingCentral Account
- Access to RingCentral Developer Portal
- Have created a RingCentral Sandbox Account for development. Read how to do this here
- Have configured your Sandbox Account to have one or more extensions which allow presence to be monitored. Read how to setup Presence monitoring here
- Node.js installed locally
- Clone
git clone https://github.com/bdeanindy/ringcentral-call-log-download-demo.git
this repository andcd ringcentral-call-log-download-demo
into the project directory - Install the dependencies
npm install
- Configure your environment
cp .env.tmpl .env
- CACHE_PREFIX is optional
- RC_EXTENSION is optional (if you are using the 101 Extension)
- VIEW can be either
Simple
orDetailed
- DATE_FROM and DATE_TO must both be an ISO8601 formatted Date which includes: date, time, timezone offset (Ex: YYYY-MM-DDTHH:MM:SS.000Z where 000Z = hours offset from Zulu time)
- LOGS_PER_PAGE must be an integer not to exceed 1000 (max records per page for Call Log API resource)
- OUTPUT_FILE_PREFIX can be any string you would like, and will be the name of the output CSV file +
---
+ unixTimeStamp +.csv
- Create an application in RingCentral Developer Portal with the following parameters:
- Platform Type: Server-only (No UI)
- Application Type: Private
- Permissions Needed: Read Accounts, Read Call Log
- Name/Description: What you choose, but I always use something easy to identify in lists
- Populate your environment file with your Application and Admin user data (the keys in the
.env
file should be pretty straight forward)
- To start the application,
npm start
- When you see "The file: myRingCentralCallLogs---{{timestamp}}.csv has been written", the application is complete and you should see a new file in the root of this project directory named as today's date and containing your call log data.
- Not seeing your CSV? Inspect the paging property of the request and see if you have more than 10K call logs (this can cause your application to be throttled)
- Anything else...add an issue and I will respond as soon as I am able