News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
RingCentral APIs
Tags: rest api, call logs, call recording
Sep 7, 2023 at 11:57am   •   2 replies  •  0 likes
Insellerate Developer

Hi Team,


We are using this API (https://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/extension/extensionId/call-log-sync) to sync the phone records into our system. To sync the recording URL, we have to find it under the "legs" property.


We noticed that there is also this API (https://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/extension/extensionId/call-log/callRecordId), where recording URL is stored both as part of the call record and under the "legs" property.


Question 1:

Why there is this difference between these two APIs in terms of how/where recording URL is stored? For a given callsid, are the two APIs returning same result?


Question 2:

We also use call-log-sync (i.e. https://platform.ringcentral.com/restapi/v1.0/account/~/call-log-sync?view=Detailed&dateFrom=2023-09-06T17:10:00Z&recordCount=250) API to query the records. However, due to large data volume, a callsid once showed up in the query result does not show again if we execute the same query with same "dateFrom" parameter and no matter how we tweak the "dateFrom", we are not able to find data for same callsid. Is there an easier way to query a call record that can return same result as this API?

2 Answers
answered on Sep 25, 2023 at 8:25am  

Hi Phong,

We sync RC phone records every min. Is recording always gonna be available and be part of main object (or legs)? For example, is it possible that for a given callsid, the recording is not available at the moment (maybe some sort of delay) when we sync. So the API just returns the call record without recording... later on if we sync the same callsid again, the recording becomes available.


Reason why we are asking this is for some reason, some of the call records are missing recordings after our sync and currently we only sync once, we don't sync again past records.


One example is: aQq83eLPTD-HzUA. We used postman to query and found out there was a recording there after we found out that our system didn't have recording for this callsid.

Request:

https://platform.ringcentral.com/restapi/v1.0/account/~/call-log-sync?syncType=FSync&dateFrom=2023-09-11T16:43:00.8102227Z&recordCount=250&view=Detailed&showDeleted=false

Response:

{
  "uri": "https://platform.ringcentral.com/restapi/v1.0/account/6297958XXXX/call-log/aQq83eLPTD-HzUA?view=Detailed",
  "id": "aQq83eLPTD-HzUA",
  ...
}

 0
on Sep 25, 2023 at 10:38am   •  0 likes

First of all, I recommend you not to post full real data on public place (I deleted them on your post). You should mask or delete those data such as an account id, extension id, phone number, name etc. If you must provide real data to help a supporter to investigate, submit a dev support ticket and provide the data via the support channel.

To your question, I already explained earlier, it is possible that a call record may not have all call data at the time it is synced, but the ISync will keep track of new data of a call record and will return the same record (identified by record id) with latest updated data in a next sync. This happens more often to a long and complicated call via a call queue and the call is transferred from one agent to another agent etc.

The recording object always present on the main call record (just for the case you sync or read the call log with the "Simple" view. The recording object also present in a call leg (for "Detailed" view). In a direct call, the call recording can be easily identified the owner and you can either pick it from the main record or from the leg record. But in a call queue call, the recording object in the main record may not tell you about the owner. So you should rely on the recording object on a call leg to identify the owner.

Also, if a call is first accepted by an agent and be recorded, then the first agent blind transferred the call to the next agent and the next agent also record the call. In this case, the recording object in the main record only refer to the first recording. And there will be 2 different recording objects in the call legs, one belongs to the first agent and another one belongs to the second agent.

BTW, what is the reason you sync every min? If your account is not such busy that may produce more than 250 calls per minute, I recommend to extend the sync period to 10 mins or more.

answered on Sep 8, 2023 at 8:02am  

A1: The recording object should be available in the main response object too. If you are so sure that the recording object exists in a leg and not present in the main object, then submit a dev support ticket with the full record payload so someone can have a look at it.

A2: The max record count is 250 records. If there are more than 250 call records, the API will ignore the dateFrom query param.


 1
on Sep 15, 2023 at 11:33am   •  0 likes

Hi Phong,


Is RingCentral sending snapshot of the call record or the finalized call record? Because our database is showing some call records did not have recording URL saved, however when we queried RingCentral using postman for the same call record, the recording URL was there in the response. Is it possible that when our system synced one particular record, the recording URL was not available yet (maybe due to the call was still ongoing) at the moment, and at later point when we queried the same record from Postman again, the record was finalized (call was finished)? That's why we saw the discrepancies?

on Sep 15, 2023 at 12:38pm   •  1 likes

The sync API might handle syncing ongoing calls in a way that it would need to update a call record later when a call is completed. I don't know how to parse and update your db. But you can always rely on the call record id as a unique and primary key in your db, then when you sync and parse the sync data, if the record exists, simply update the other data fields of that record.

If syncing the data does not need to be near real-time. If it can be synced a few hours or a day from the current time, I would recommend to use the /call-log to read call records. You can set the the dateFrom = dateTo (minus ~10 millisecond) of a previous read.

on Sep 15, 2023 at 3:58pm   •  0 likes

There is no difference between the two APIs right? For one call id, the result would be same for both?

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

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


We are using first one now. We may need to switch to second one since it is more flexible and allows us to specify a time range.

on Sep 18, 2023 at 7:19am   •  0 likes

There should not be any different between the record you get from syncing and the record you read from the call-log.

My latest test, ongoing call is not synced until the call is completed after about 5-10 secs.

on Sep 18, 2023 at 9:32am   •  0 likes

You mean it's not possible for our system to retrieve snapshot of call (ongoing call) using either API based on your latest test? The call returned from API is finalized and completed at any moment?

on Sep 18, 2023 at 10:03am   •  1 likes

Yes. Call log will not log on going calls. For active calls, you can call this API to get a list of all (entire account) active calls.

That's why I recommended you to read a few hours or a day from the current date/time to make sure there is no active calls during the dateFrom/dateTo period time you call the call-log endpoint.

But if you use the /sync, then the system will take care of active calls while you sync with the Isync token.

on Sep 18, 2023 at 10:23am   •  0 likes

"But if you use the /sync, then the system will take care of active calls while you sync with the Isync token."

Can you please elaborate a little bit more on how your /sync endpoint take care of active calls?

on Sep 18, 2023 at 11:07am   •  1 likes

It means that at the moment you call the ISync with a valid syncToken, if the active calls are still active (even if those calls started way before the last sync) or just got completed a second ago, the system will return them the next time you ISync again.

on Sep 18, 2023 at 5:26pm   •  0 likes

Hi Phong,


I appreciate your patience explaining. Can you please confirm below highlighted based on what we discussed?


call-log-sync won't send active/ongoing calls to our system. I tested on my end and our endpoint didn't receive any data when the call was active. However, a call record maybe updated (multiple times) later. If an update happened, call-log-sync will send same record to us again. I noticed on my end that there were multiple syncs for one id "L1oEc04R5LgADUA" at different timestamps, which probably tells that it was updated a few times since after initial sync.


Also do you have an API that can update existing call record? I didn't find one from your API reference page.


Thank you!






on Sep 19, 2023 at 9:21am   •  0 likes

As long as the SyncToken is valid, you can rely on the ISync call using the syncToken to fetch new call records, even if a call record was not completed during the previous sync.

I cannot explain in details how and when a call record might be updated multiple times. But a call record id must be the same. So when syncing the call data with your db, you just need to check the record id, if exists in your db, update it with new data, if not add a new record in your db.



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us