question

Tanmay Kumar avatar image
Tanmay Kumar asked ·

Ways to export call log

Call log record can be obtain using RingCentral Api and can be filtered using date **To** and **From**.

I have went through the Api reference to get call log with API here.


We can see the following Api is used to get all the call log record:

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/call-log


But we need to export this log something in csv format file. What is the way we can do it in a file and save it on local disc?

call log
1 |1000 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

· Write an Answer
Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered ·

There are many ways to do it. If you check this reference here you will see, it is suggested to log into RingCentral Online Account Portal (https://service.ringcentral.com) as an admin view your Call Log data, and download each page into one single csv.


Another reference here suggest to use a programming language to call the call log API and save it as local file.

example, with Node JS and can run it locally on your machine . All you need to do is need to login the developer portal and create an app with the read call log permission. App platform type will be Server only (no UI). Client ID and Client Secret can be used in the sample code in the link given.


code snippet:

platform.get('/account/~/extension/~/call-log', params)
.then(function(resp){
var json = resp.json()
  if (json.records.length > 0){
    var fs = require('fs')
      var cvs = 'uri,startTime,duration,type,direction,action,result,to_name,from_name,transport'
      for (var record of json.records){
        //console.log(JSON.stringify(record))
        cvs += "\r\n"
       cvs += record.uri + ','
       cvs += record.startTime + ','
        cvs += record.duration + ','
        cvs += record.type + ','
      cvs += record.direction + ','
      cvs += record.action + ','
       cvs += record.result + ','
        if (record.to.hasOwnProperty('name'))
          cvs += record.to.name + ','
       else
         cvs += 'null,'
      if (record.hasOwnProperty('from')){
         if (record.from.hasOwnProperty('name'))
            cvs += record.from.name + ','
          else
            cvs += 'null,'
       }else
       cvs += 'null,'
       cvs += record.transport


1 comment Share
1 |1000 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.

Let me check... will come back for queries

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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