Export CDRs

Triggers an export task and exports the CDRs that match the filter conditions.

Request URL

POST {base_url}/uc-creport/api/v1/cdr/export/trigger

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code Yes String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Body parameters
Parameter Required Type Description
filter Yes Object<Search_Filter> The filter conditions of the CDRs to export. The supported fields are the same as those of the Query CDRs interface.
rangeType No String

The range of the CDR data to export.

Valid value:

  • list_only: Export the main records only.
  • leg_only: Export the call leg records only.
  • list_and_leg: Export both the main records and the call leg records.
format No String

The format of the exported file.

Valid value:

  • csv
  • xls
  • pdf
  • html
durationFormat No String

The format of the duration in the exported file.

Valid value:

  • seconds
  • hhmmss
exportFields No String

The range of the fields to export.

Valid value:

  • all: Export all fields.
  • selected: Export the fields in selectedFields.
selectedFields No Array<Export_Field_Selection> The list of the fields to export. This parameter is valid only when exportFields is selected.
Search_Filter
Parameter Required Type Description
pageNumber No Integer The page number to retrieve.
pageSize No Integer The number of records to retrieve per page.
startTimeFrom No String The start of the call time range, in Unix timestamp format (microseconds).
startTimeTo No String The end of the call time range, in Unix timestamp format (microseconds).
callType No String

The call type to filter by.

Valid value:

  • inbound: Inbound calls.
  • outbound: Outbound calls.
  • internal: Internal calls.
lastCallStatus No String

The list of final call statuses, separated by commas.

Valid value:

  • answered
  • no_answer
  • abandoned
  • busy
  • failed
  • voicemail
callFrom No String The caller number or name to search for.
callTo No String The callee number or name to search for.
trunkNames No String The list of trunk names, separated by commas.
didNumbers No String The list of DID numbers, separated by commas.
userNumbers No String The list of extension numbers, separated by commas.
hasRecording No String

Whether to export only CDRs that have recordings.

Valid value:

  • yes
  • no
queueNumbers No String The list of queue numbers, separated by commas.
ringGroupNumbers No String The list of ring group numbers, separated by commas.
ivrNumbers No String The list of IVR numbers, separated by commas.
dodNumber No String The DOD number to filter by.
callerIp No String The IP address of the caller to filter by.
pinCode No String The PIN code to filter by.
uid No String The UID of the CDR to search for.
secondParticipant No String The number or name of the second participant to search for.
lastParticipant No String The number or name of the last participant to search for.
segmentsFilter No Object<Range_Filter> The range filter of the call segments.
sorts No Array<Sort_Condition> The sort conditions. The supported fields include uid, timestamp, call_type, last_call_status, and total_duration.
aiReceptionistNumbers No String The list of AI receptionist numbers, separated by commas.
shakenAttestations No Array<String>

The list of SHAKEN attestation levels to filter by.

Valid value:

  • A
  • B
  • C
  • Invalid
  • Unknown
  • Unsigned
Range_Filter
Parameter Required Type Description
operator No String

The comparison operator.

Valid value:

  • =
  • <
  • <=
  • >
  • >=
  • ~
value No Integer The value to compare with, used when operator is a single-value comparison operator.
min No Integer The minimum value, used for range filtering.
max No Integer The maximum value, used for range filtering.
Sort_Condition
Parameter Required Type Description
property No String The name of the field to sort by.
direction No String The sort order.

Valid value:

  • asc: Sort in ascending order.
  • desc: Sort in descending order.
Export_Field_Selection
Parameter Required Type Description
key No String The identifier of the field to export, such as caller_number and tenant_code.
title No String The custom header title of the field in the exported CSV file.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Trigger_Result> The result of the request.
Trigger_Result
Parameter Type Description
taskId String The ID of the export task. You can use this ID to query the task details.
status String The status of the export task.

Example

Request example

POST /uc-creport/api/v1/cdr/export/trigger HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxMDAwQGNvbG9ydGVzdDIiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJ1c2VyX25hbWUiOiIxMDAwQGNvbG9ydGVzdDIiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiY2xpZW50X2V4dCI6eyJkZXNjcmlwdGlvbiI6IueuoeeQhuWQjuWPsFdlYuW6lOeUqCIsInBsYXRmb3JtIjoid2ViIn0sImV4cCI6MTc5MzM1NTUwMiwiaWF0IjoxNzkzMzMzOTAyLCJqdGkiOiIxMGQwNGYwYy0yMTIxLTRiMzktYjFlZC1kNDY5MDY0ODlhODQiLCJjbGllbnRfaWQiOiJub3ZvLWFkbWluLXdlYiIsInNpZCI6IjlkMTg5NjI3LTZhZTAtNDYxMC04ZTFhLWNiZWJmYzdlYTdmZiIsInVzZXJfZXh0Ijp7InJvbGVJZHMiOlsxMDJdLCJwdWlkIjozMDc2OTEzNjQ0OTE1OTk4NzIwLCJ0ZW5hbnRJZCI6MjA3OTUwNDIwNTMwOTE5NDI0MSwicGFyZW50VWNJZCI6MzA3NjkxMzY0NDg5MDgzMjg5NiwidGVuYW50Q29kZSI6ImNvbG9ydGVzdDIiLCJ0eXBlIjoiVF9VU0VSIiwidXNlcklkIjoyMDc5NzQ2OTE1Mzg4MDc2MDMzLCJlbWFpbCI6Imxlb0BzYW1wbGUuY29tIiwidXNlcm5hbWUiOiIxMDAwQGNvbG9ydGVzdDIiLCJ1Y0lkIjozMDc2OTEzNjQ0ODkwODMyODk2fX0.cpY9aTg-Twaa1itEHREfJRX2RaYmalfGeof0An6DYSYBl9moSYvsjsZwImpId5xKb1qsPsec0KSXTmASV9kMgonf1uv6AtNRw702SroZxYTHwA9_lwxM8TY66aOAyoeiewHhA0sCDtg-ZGiDaatHxSitiLMi4MMr8qyzvuXF_44bcucYSaf8Z7Iokiud9cM67Z4dAFdxQ_SSbmFtAmTa78VuSPA0R7fFyq86Fn-p6Xk767i0AXJI8a7H7GNKMPwuc5NJ3BtWcbWx8M_DKKNVO58wMO2d9_Q13-qjlmX44h0ml_GqtqSqkZS7wz3Bg2jPT3Q2yc7Ijm9rxqr1UvbGLg
x-tenant-code: jint
Content-Type: application/json
{
  "filter": {
    "pageNumber": 1,
    "pageSize": 10,
    "callType": "internal"
  },
  "rangeType": "list_only",
  "format": "csv",
  "durationFormat": "seconds",
  "exportFields": "all"
}

Response example

HTTP/1.1 200 OK
{
  "requestId": "a8f59bf4b7c7857851a65c498fb8b55b",
  "code": "200",
  "message": "SUCCESS",
  "detailMessage": "",
  "result": {
    "taskId": "374411691270496256",
    "status": "started"
  }
}