How to retrieve CDRs

API Docs by APIMATIC

How to retrieve CDRs
#

  • REST
  • Java

How to retrieve CDRs
#

How to retrieve CDRs
#

Use the CDR (Call Detail Record) API to query Voiso interaction detail records from your account using various query parameters as filters. This is identical to the Call Detail Records page in the Voiso application.

Important: You may only query CDRs for which access has been granted to you by your account privileges. Refer to Security Access Groups.

To build a CDR request, use the following APIs to get IDs and other details for these contact center objects:

Query interaction details
#

The CDR API enables you to query your contact center interaction details and export them to any Business Intelligence (BI), CRM, or other services. Use the CDR GET request to create an application that regularly queries your data.

Request example
#

The following is an example of a request:

GET https://cluster1.voiso.com/api/v2/cdr
    ?key=a387aaf1f101fc...fe284aaf61
    &page=1
    &per_page=1000
    &type=outbound
    &start_date=2022-12-01

Querying more than 10,000 records
#

The CDR API returns up to 10,000 results per request. You must make multiple requests to obtain more than 10,000 results, adding the search_token parameter to subsequent requests.

If your first request returns 10,000 records, but additional records match the search criteria, the response includes the search_token parameter and value. For example:

Response
#

{
    "records": [ …array of records… ],
    "total":176,
    "page":1,
    "search_token": "WzE2NjkwMTcyNDkwMTUsImNkcl9pdGVtI2MzNTY2ZTFiL"
}

To continue searching the records from where you left off, enter your request again, adding the search_token parameter. For example:

https://cluster1.voiso.com/api/v2/cdr
    ?key=a387aaf1f101fc...fe284aaf61
    &page=1
    &per_page=1000
    &type=outbound
    &start_date=2022-12-01
    &search_token=WzE2NjkwMTcyNDkwMTUsImNkcl9pdGVtI2MzNTY2ZTFiL

Repeat the search process, replacing the search_token value with the new value in the response until the response is "search_token": null. For example:

{
    "records":[],
    "total":310,
    "search_token":null
}

Parameter reference
#

The following parameters are supported by the CDR API.

Parameter NameDescriptionRequiredTypeExample
keyThe API key of a specific user.Requiredstringuser_api_key
search_tokenParameter should be used to query more than 10000 records.Requiredstringdkeouof13kjhk4HHH59
pageIndicates the current page numberOptionalinteger (int32)1
per_pageNumber of records per pageOptionalinteger (int32)20
start_dateInclude only record on or after this date. Must be in the 'YYYY-MM-DD' format (ISO 8601).Optionalstring2020-04-01
end_dateInclude only record on or before this date. Must be in the 'YYYY-MM-DD' format (ISO 8601).Optionalstring2020-05-01
cliThe call line identity (CLI) calling number. A 'starting with' search of the ANI/From field.Optionalstring197
numberThe called number. A 'starting with' search of the DNIS/To field.Optionalstring187
wildcard_cliThe call line identity (CLI) calling number. An 'includes' search of the ANI/From field.Optionalstring971231
wildcard_numberThe called number. An 'includes' search of the DNIS/To field.Optionalstring7751
typeDirection and type of the interactionOptionaltype (custom schema)-
dispositionRetrieved call outcomeOptionaldisposition_code (custom schema)-
queue_idsSingle or multiple queue IDs, separated by commas. These can be obtained with the /api/v2/cdr/queues methodOptionalstring199, 201
agent_idsSingle or multiple agent IDs, separated by commas. These can be obtained with the /api/v2/cdr/agents methodOptionalstring1,2,3
team_idsSingle or multiple agent team IDs, separated by commas. These can be obtained with the /api/v2/cdr/teams methodOptionalstring3,4
wrapup_codesSingle or multiple wrap-up code IDs, separated by commas. These can be obtained with the /api/v2/cdr/wrapup_codes methodOptionalstring0001, 1002
eventStandard call eventsOptionalevents (custom schema)-
end_reasonStandard call end reasonsOptionalend_reason (custom schema)-
campaign_idsSingle or multiple campaign IDs, separated by commas. These can be obtained with the /api/v2/cdr/campaigns methodOptionalstring15, 13, 22
duration_fromCalls which have a duration longer than the specified value (in seconds)Optionalinteger (int32)1
duration_toCalls which have a duration shorter than the specified value (in seconds)Optionalinteger (int32)10
dialing_time_fromCalls which have a dialing time longer than the specified value (in seconds)Optionalinteger (int32)1
dialing_time_toCalls which have a dialing time shorter than the specified value (in seconds)Optionalinteger (int32)10
talk_time_fromCalls which have a talk time longer than the specified value (in seconds)Optionalinteger (int32)1
talk_time_toCalls which have a talk time shorter than the specified value (in seconds)Optionalinteger (int32)10
hold_time_fromCalls which have a hold time longer than the specified value (in seconds)Optionalinteger (int32)1
hold_time_toCalls which have a hold time shorter than the specified value (in seconds)Optionalinteger (int32)10
ivr_time_fromCalls which have a pre-queue (IVR) time longer than the specified value (in seconds)Optionalinteger (int32)1
ivr_time_toCalls which have a pre-queue (IVR) time shorter than the specified value (in seconds)Optionalinteger (int32)10
queue_time_fromCalls which have a queue time longer than the specified value (in seconds)Optionalinteger (int32)1
queue_time_toCalls which have a queue time shorter than the specified value (in seconds)Optionalinteger (int32)10
deleted_agent_idsSingle or multiple deleted (archived) agent IDs, separated by commas. These can be obtained with the /api/v2/cdr/deleted_agents methodOptionalstring15, 16, 17
first_seenSet to Required to get only new numbers that have never been dialed beforeOptionalfirst_seen (custom schema)-
lead_sourceCalls with a specified lead source type (available only for dialer campaigns with a specified lead source)OptionalstringGoogle ADS
start_datetimeMust be in this format: 'YYYY-MM-DD'T'HH:MM:SS'.Optionalstring2022-08-19T02:56:02
end_datetimeMust be in this format: 'YYYY-MM-DD'T'HH:MM:SS'.Optionalstring2022-08-19T02:56:02
uuidUUID of the call.Optionalstringa6c74840-574b-4e6e-baad-6b69bc38ccfc
related_call_uuidUUID of the parent call if the callback was requested from the queue.Optionalstring8d1371d2-e166-4677-b158-b1782ddd412d
destination_nameThe name of destination country. Valid for outbound calls only.OptionalstringGermany - Other