question

Insellerate Developer avatar image
Insellerate Developer asked Phong Vu commented

RingCentral APIs

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?

rest apicall logscall recording
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 Phong Vu commented

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.

10 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.

Insellerate Developer avatar image Insellerate Developer commented ·

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?

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Insellerate Developer commented ·

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.

1 Like 1 ·
Insellerate Developer avatar image Insellerate Developer Phong Vu ♦♦ commented ·

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.

0 Likes 0 ·
Show more comments
Insellerate Developer avatar image
Insellerate Developer answered Phong Vu commented

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",
  ...
}
1 comment
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 ·

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.

0 Likes 0 ·

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