question

Jorge Correia avatar image
Jorge Correia asked Phong Vu commented

Sychronization Flow - Call Log Records

I'm doing some investigation about how to extract call log records from RingCentral to run some analytics against the data. I'm trying to use the Sync API endpoint however I've a few questions about the synchronization flow and how it works:

  • How the 250 records limit works? If initially I've more than 250 records on RingCentral how can I extract those records?
  • If I've more than 250 records and I do a FSync call, how many record are returned? 250? More? Exception?
  • I've found this article (Sync RingCentral Call Log into Google Sheets) and took a look on the code and the implemented flow is the following: Do a FSync call with recordCount = 250, then if response contains more than 250 records (is this possible?), request older data through "Get Company Call Log Records" search endpoint. Then I'm assuming that I can start using the ISync using the SyncInfo from the initial FSync. Is this the recommended flow?
  • If ISync returns an error because there is more than 250 new records, what is the best way to restart the synchronization? Call the FSync and pass the LastSyncInfo.syncTime as the value for the dateFrom filter?


For testing purposes and to play with this synchronization process it will be very useful for me to have a huge number of calls on my sandbox account. Is there any quick away to generate dummy calls to be extracted through the API?


Many thanks.

rest api
1 |3000

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

Phong Vu avatar image
Phong Vu answered Jorge Correia published

I recommend to use the call-log for reading your account or extension call-log. Read this blog for more information and sample project. You can setup a timer or cronjob to read the call-log daily or within a period of time. Take care of the API rate limit if you have a large call log.

Using the sync is okay but it limits you to only 250 records per request.

Finally, to generate more call data, download the RingCentral Desktop phone app (look at the right hand-side pane of this page and see the "DEVELOPER SANDBOX TOOLS" for details. You can add more users (up to 4 users) to your sandbox account and you can make calls between those users or any external numbers for richer call data.

1 |3000

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

Jorge Correia avatar image
Jorge Correia answered Phong Vu commented

@Phong Vu thanks for your reply. I would also prefer to use the call-lo endpoint, but the reason why I was looking to the sync mechanism was to take advantage of the sync token and remove the responsibility to calculate the data differences from my system :) . Using the call-log endpoint I need to use the date-from and date-to filters to get new calls and I need to handle the scenario where I have active calls that start in a date windows but did not end on the same date window.

E.g.:

Call #1 - GetCompanyCallLogRecords endpoint with datefrom: 2021-08-01T00:00:00.000Z and dateto: 2021-08-01T23:59:59.999Z

Call #2 - GetCompanyCallLogRecords endpoint with datefrom: 2021-08-02T00:00:00.000Z and dateto: 2021-08-02T23:59:59.999Z

With these 2 queries I will miss all the calls that have started before 2021-08-01T23:59:59.999Z but ended after 2021-08-01T23:59:59.999Z. And If change the 2 call to use an offset of for instance 2h and change the datefrom to 2021-08-01T22:00:00.000Z I will need to handle duplications.

Is there any max duration imposed by RingCentral or a call can be active forever? Do you have any advice how to deal with this scenarios to ensure no data is missed? From my reading about the sync approach I also got the impression that a call data can change after its end, is that the case? Or is the call-log data for a call immutable as soon as it ends?

7 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

Sorry for the hiccup on the site that your comments did not get posted. I am asking the support team to check and fix that. Thanks for reporting it.

Back to your question.

First of all, do you need to read the call log at near real-time? If the answer is yes, then you are right, you may miss call log items of active calls during the date/time range you read the call log. If the answer is no, you can alway read the call log a 24 hrs back from the current time, this would "make sure" to be out-of-range of those active calls.

For the Call log sync API, I noticed a couple of issues and am asking the team to investigate it to make sure it would work correctly. The problem is that it seems ignoring the 'dateTo' and always take the default current day. Another problem is that it returns call log items backward starting from the current date/time till the end. So calling the API with ISync using the syncToken will not getting the latest call log items.

0 Likes 0 ·
Jorge Correia avatar image Jorge Correia Phong Vu ♦♦ commented ·

At the moment we do not need to read the call log at near real time and a few hours delay is acceptable. Can I also have your thoughts on my other questions:

  • Is the filter on the startTime (Get Company Call Log Records endpoint) by design or a bug? It makes more sense filter on the endTime...
  • Is there any max duration imposed by RingCentral or a call can be active forever?
0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Jorge Correia commented ·

1. There is no 'startTime' filter but the 'dateFrom' means date and time and it reflects the 'startTime' on a call log item. I notice that the 'dateFrom' filter does not work as expected in the sandbox environment, but it works precisely on the production environment.

2. I don't think that we impose a max call duration.


Here is my quick test to verify the 'startTime' on the production env.

// Queries
{
  dateFrom: "2021-07-02T19:36:00.000Z",
  dateTo: "2021-07-03T16:57:59.999Z"
}

// Response
{"uri":"https://platform.ringcentral.com/restapi...",
"startTime":"2021-07-03T16:26:40.449Z",
========
...

{"uri":"https://platform.ringcentral.com/restapi...",
"startTime":"2021-07-02T19:36:36.765Z",

Change the dateFrom back one minute
// Queries
{
  dateFrom: "2021-07-02T19:37:00.000Z",
  dateTo: "2021-07-03T16:57:59.999Z"
}

// Response
{"uri":"https://platform.ringcentral.com/restapi...",
"startTime":"2021-07-03T16:26:40.449Z",
========
...

{"uri":"https://platform.ringcentral.com/restapi...",
"startTime":"2021-07-02T21:46:33.374Z",
0 Likes 0 ·
Show more comments

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