Skip to content

NXCC API cdrQueryByOrder

henryou edited this page May 17, 2024 · 1 revision

Query CDR records through orderid

  • URL:https://api2.nxcloud.com/saas/cc/openapi/cdr/queryByOrderId
  • Method:POST
  • Content-Type:application/json
  • Required:yes

Authentication Mechanism

For authentication rules, please refer to: API Interface Call Agreement

Request Parameters

header:

Parameter Name Type Required Example Value Description
accessKey String Y fme2na3kdi3ki User identity identifier
ts String Y 1655710885431 Timestamp of the current request (in milliseconds). The NX server allows a maximum time error of 60 seconds for client requests.
bizType String Y 8 Business type, fixed value “8”
action String Y cc Business operation, fixed value “cc”
sign String Y 6e9506557d1f289501d333ee2c365826 API parameter signature, Signature Algorithm

body :

Parameter Name Type Required Example Value Description
tenantId Integer Y 144 Team ID, configurable from Niuxin page
orderId string N Business ID, order ID initiated by the customer side

Request Example

body(application/json):

{
  "tenantId": 144,
  "orderId": "12333333XXX"
}

Response Parameters

Name Type Description
code Integer Result code
data Object Response data
msg String Result message

Successful Request

  • data :
Parameter Name Type Description
agentName String Agent account, might be empty
agentNickName String Agent nickname, might be empty
answered Boolean Whether answered
answerTime Long Call answer time (timestamp in milliseconds)
callDuration Integer Call duration (in seconds)
callee String Callee number
caller String Caller number
callId String Call ID
direction Integer Call direction: 0: inbound, 1: outbound, 2: AICC
dtmfKeys String DTMF keys, separated by commas if multiple
endTime Long Call end time (timestamp in milliseconds)
hangupBy Integer Hangup by: 0: agent, 1: user, 2: unknown
hangupCode Integer Hangup reason code
callStatus String Call status
hangupReason String Hangup reason description
inQueueTime Long Queue entry time (timestamp in milliseconds)
leaveMsgUrl String Voicemail URL
orderId String Order ID
other String Pass-through information
intent String Intent name
outQueueTime Long Queue exit time (timestamp in milliseconds)
queueDuration Integer Queue duration (in seconds)
recordUrl String Recording URL
ringDuration Integer Ring duration (in seconds)
ringTime Long Ring start time (timestamp in milliseconds)
startTime Long Call start time (timestamp in milliseconds)
taskId String Task ID, displayed for AICC tasks (direction=2)
totalCustomerPrice Double Cost

Response Example

Success Example

{
    "reqId": "a23738fb613d889026fa2c8f4e4378f1",
    "code": 0,
    "msg": "Success",
    "data": [
        {
            "agentName": null,
            "agentNickName": null,
            "answered": false,
            "answerTime": 0,
            "callDuration": 0,
            "callee": "85235757580",
            "caller": "85215236100",
            "callId": "63b09b9a163616c6c009cb326",
            "direction": 0,
            "dtmfKeys": null,
            "endTime": 1690442498901,
            "hangupBy": 0,
            "hangupCode": 1103,
            "callStatus": "Missed Call",
            "hangupReason": "User abandoned while in queue",
            "inQueueTime": 1690442492861,
            "leaveMsgUrl": null,
            "orderId": "",
            "other": null,
            "intent": null,
            "outQueueTime": 1690442498000,
            "queueDuration": 5139,
            "recordUrl": null,
            "ringDuration": 6,
            "ringTime": 1690442492000,
            "startTime": 1690442492841,
            "taskId": "",
            "totalCustomerPrice": 0.035
        },
        {
            "agentName": "NX094450006938",
            "agentNickName": "Example Agent",
            "answered": true,
            "answerTime": 1690423244000,
            "callDuration": 5,
            "callee": "85235757568",
            "caller": "85238531117",
            "callId": "6605fcd9563616c6c009c6240",
            "direction": 0,
            "dtmfKeys": null,
            "endTime": 1690423248124,
            "hangupBy": 1,
            "hangupCode": 1001,
            "callStatus": "Normal",
            "hangupReason": "Agent hang-up",
            "inQueueTime": 1690423237744,
            "leaveMsgUrl": null,
            "orderId": "",
            "other": null,
            "intent": null,
            "outQueueTime": 1690423244000,
            "queueDuration": 6,
            "recordUrl": "https://*********.mp3",
            "ringDuration": 7,
            "ringTime": 1690423237000,
            "startTime": 1690423237704,
            "taskId": "",
            "totalCustomerPrice": 0.035
        }
    ]
}

Failure Example

{
  "reqId": "FFDD1791E22F4D9DBA967C245C58E544",
  "code": 41000,
  "msg": "End date cannot be empty",
  "data": {}
}

Response Code Description

code message Resolution
0 Request successful
88 Request failed Please contact technical support to resolve the issue
99 System error Please contact technical support to resolve the issue
1000~100X Authentication failed See the API Authentication section for details

Introduction

WhatsApp

Short message

Voice

Call Center(NXLink)

Call Center(Callbot)

Flash Call

Short links

邮件验证码

DID号码

通用

号码检测

Clone this wiki locally