Home / Developers / Call Center API / Query call detail records
CALL CENTER API · ENGLISH REFERENCE

Query call detail records

Retrieve paginated call detail records using account, agent, service, date and other filters.

API path/openapi/V2.0.8/getCdrList

Common request fields

The authentication object is required. Use the account credentials provided during onboarding; see the API overview. Request seq and userData are separate from authentication.seq.

FieldTypeRequiredLength / constraintsDescription
seqStringNo0–20Message sequence number; currently not used by these request fields.
userDataStringNo0–60Customer-defined correlation data; truncated beyond 60 characters. Use letters, digits and the documented ASCII punctuation.

Query parameters

FieldTypeRequiredLength / constraintsDescription
pageIntNoDefault 1Page number.
sizeIntNoDefault 500Rows per page.
taskIDIntNo—Task ID; source notes that task ID or task name must be supplied for task-specific queries.
agentArrayNo1–1000Agent staff numbers.
serviceTypeIntNo—1 manual, 2 inbound, 3 internal, 4 automatic outbound, 5 click-to-call, 7 recording, 9 transfer, 17 rental, 18 settlement, 19 voice verification code, 21 voice notification.
startTimeStringNoYYYY-MM-DD HH:mm:ssStart time; defaults to current day if omitted.
endTimeStringNoYYYY-MM-DD HH:mm:ssEnd time; defaults to current day if omitted.
callerStringNo1–30Calling number.
numberXStringNo1–30Virtual number (X number).
calleeStringNo1–30Called number.
timeLengthMinIntNo—Minimum call duration.
timeLengthMaxIntNo—Maximum call duration.
startKeyIntNo—Blank = unsorted; 1 enables sorting. For subsequent pages use the last returned key.
userDataListArrayNo1–1000Customer correlation-data values to match.

Unencrypted request example

{
  "authentication": {
    "customer": "<CUSTOMER_ID>",
    "timestamp": "<REQUEST_TIMESTAMP>",
    "seq": "<UNIQUE_SEQUENCE>",
    "digest": "<COMPUTED_DIGEST>"
  },
  "request": {
    "seq": "<REQUEST_SEQUENCE>",
    "userData": "<REFERENCE>",
    "page": 1,
    "size": 500,
    "taskID": "",
    "agent": [],
    "serviceType": "",
    "startTime": "",
    "endTime": "",
    "caller": "",
    "numberX": "",
    "callee": "",
    "timeLengthMin": "",
    "timeLengthMax": "",
    "startKey": "",
    "userDataList": []
  }
}

Optional encrypted request

The source describes an optional 16-character authentication.secretKey. When supplied, request is encrypted instead of an object, and the returned data is padded using PKCS5Padding, encrypted and Base64-encoded. Confirm the exact supported encryption implementation and secure key exchange with the ANNC implementation team.

{
  "authentication": {
    "customer": "<CUSTOMER_ID>",
    "timestamp": "<REQUEST_TIMESTAMP>",
    "seq": "<UNIQUE_SEQUENCE>",
    "digest": "<COMPUTED_DIGEST>",
    "secretKey": "<16_CHARACTER_KEY>"
  },
  "request": "<BASE64_ENCRYPTED_REQUEST>"
}

Response envelope

The top-level result describes the request; data.response carries command-specific status and echoed correlation fields. logs may include debugging information when enabled.

FieldTypeDescription
result.errorStringError code.
result.msgStringRequest result description.
data.seqStringMessage sequence number.
data.responseObjectCommand-level response.
data.response.seqStringEchoed request sequence.
data.response.userDataStringEchoed customer data.
data.response.resultObjectCommand result; inspect error.

CDR response fields

data.response.total reports the number of records; cdr is an array; page and size identify the page.

FieldTypeDescription
keyStringCDR ID.
agentStringAgent staff number.
startTimeStringCall start time.
ringTimeStringRinging start time.
answerTimeStringCall answer time.
byeTimeStringCall end time.
callerStringCalling number.
numberXStringVirtual number (X number).
calleeStringCalled number.
feeStringCharge.
filenameStringRecording file reference.
resultString1 = answered; 2 = not answered; 3 = invalid/unassigned number.
areaStringProvince / region.
cityStringCity.
spNameStringCarrier.
keyPressStringAll keypad input, concatenated in order (e.g., 24).
callResultStringCall analysis result.
typeResultStringResult type.
errMsgStringError returned by the API route.
errMsgCNStringRoute error translated into Chinese.
trunkIndexStringTrunk ID.
trunkTypeString1 = SIP trunk; 2 = AG trunk.
trunkNameStringSIP trunk name or AG trunk username.
trunkPeerIPStringSIP peer details; blank for AG trunk.
trunkUsernameStringRegistered trunk username; blank for non-registered SIP or AG trunk.
releaseCauseStringRelease cause code.
releasePartStringParty that released the call.
serviceTypeStringService type (see request enum).
timeLengthStringCall duration.
sessionStringUnique CDR identifier.
userDataStringReturned customer data.
taskIDStringTask ID.
labelObjectCustomer labels.
customerStringEnterprise identifier.
{
  "result": {
    "error": 0,
    "msg": "Success"
  },
  "data": {
    "seq": "<SEQUENCE>",
    "response": {
      "seq": "<REQUEST_SEQUENCE>",
      "userData": "<REFERENCE>",
      "result": {
        "error": 0
      },
      "total": "1",
      "cdr": [
        {
          "key": "",
          "agent": "",
          "startTime": "",
          "ringTime": "",
          "answerTime": "",
          "byeTime": "",
          "caller": "",
          "numberX": "",
          "callee": "",
          "fee": "",
          "filename": "",
          "result": "",
          "area": "",
          "city": "",
          "spName": "",
          "keyPress": "",
          "callResult": "",
          "typeResult": "",
          "errMsg": "",
          "errMsgCN": "",
          "trunkIndex": "",
          "trunkType": "",
          "trunkName": "",
          "trunkPeerIP": "",
          "trunkUsername": "",
          "releaseCause": "",
          "releasePart": "",
          "serviceType": "",
          "timeLength": "",
          "session": "",
          "userData": "",
          "taskID": "",
          "label": "",
          "customer": ""
        }
      ],
      "page": 1,
      "size": 500
    }
  },
  "logs": null
}

Encrypted response example

After decryption, data contains the same structure as the unencrypted response.

{
  "result": {
    "error": 0,
    "msg": "Success"
  },
  "data": "<BASE64_ENCRYPTED_DATA>",
  "logs": null
}

Recording access

Use the returned recording reference and the authorized recording interface. Requesting IP allowlisting is required.

Examples use placeholders. Request your approved connection details and credentials through ANNC onboarding.
WhatsApp