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.
@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?
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.