
# 查询指定callId的通话详单
#### 场景描述
根据呼叫流水号查询通话详单，所查询的数据留存日期为一天，时区为话单的租户时区。
#### 接口方法
设置成"POST"。该接口仅支持POST方法，不支持PUT、GET和DELTE等方法。
#### 请求URL
https://ip:port/rest/cmsapp/v1/openapi/calldata/querycalldetailbyid
其中，公有云环境请联系管理员获取，ip为CC-CMS服务器地址，port为CC-CMS服务器的HTTPS端口号。
非公有云环境如果配置了NSLB服务，ip请填写NSLB的服务器地址，port为CC-CMS服务在NSLB映射的HTTPS端口号。
#### 请求说明
表1请求头参数 
| 序号 | 名称            | 参数类型   | 是否必选 | 说明                                                                                                                            |
|:---|:---|:---|:---|:---|
| 1  | Content-Type  | String | True | 固定填 application/json;charset=UTF-8。                                                                                           |
| 2  | Authorization | String | True | 生成方式参见[C2 监控/系统外呼/话单/知识库类接口鉴权方式](https://support.huaweicloud.com/api-ccfs-cec/cec_07_0003.html#ZH-CN_TOPIC_0000002481273406)。 |
   
表2消息体参数说明。 
| 序号 | 名称       | 参数类型   | 是否必选 | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|:---|
| 1  | ccId     | int    | True | 呼叫中心编号。 取值范围：1～65535                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 2  | isCallin | string | True | 是否呼入通话。 取值范围： - "true"代表呼入，  - "false"代表呼出   |
| 3  | callId   | string | True | 呼叫ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   
#### 响应消息
表3消息体参数说明 
| 序号 | 名称          | 参数类型   | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| 1  | result      | String | 查询结果。取值如下： - 0：成功  - 其他：失败   失败的原因说明请参见[错误码参考](https://support.huaweicloud.com/api-ccfs-cec/cec_07_0696.html#ZH-CN_TOPIC_0000002481273824)。 说明： 当前字段为兼容8.13及其之前版本接口响应参数使用。 |
| 2  | resultCode  | string | 查询结果。取值如下： - "0100000"：成功  - 其他：失败   失败的原因说明请参见[错误码参考](https://support.huaweicloud.com/api-ccfs-cec/cec_07_0696.html#ZH-CN_TOPIC_0000002481273824)。                                                                                                                                                                                                                           |
| 3  | resultDatas | object | 查询成功后，返回结果信息的对象。 该数组中对象的参数说明请参见[表4]。 说明： 当前字段为兼容8.13及其之前版本接口响应参数使用。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 2  | resultDesc  | object | 查询成功后，返回结果信息的对象。 该数组中对象的参数说明请参见[表4]。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   
 表4resultDesc/resultDatas对象参数说明 
| 序号   | 名称            | 参数类型   | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|:---|:---|:---|:---|
| 2.1  | vdn           | int    | 虚拟呼叫中心编号。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| 2.2  | callId        | string | 呼叫ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 2.3  | callerNo      | string | 呼叫的主叫号码。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 2.4  | calleeNo      | string | 呼叫的被叫号码。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 2.5  | callType      | int    | 呼叫类型，请参见[表1](https://support.huaweicloud.com/api-ccfs-cec/cec_07_0700.html#ZH-CN_TOPIC_0000002481273828__zh-cn_topic_0000002478109806_zh-cn_topic_0000001843049333_zh-cn_topic_0000001451970525_zh-cn_topic_0240433944_table28185967)                                                                                                                                                                                                                                                                                                                                                                           |
| 2.6  | agentId       | int    | 座席工号。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 2.7  | skillId       | int    | 技能队列编号。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 2.8  | anonyCall     | int    | 匿名呼叫标识。(只有呼入时才有值)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 2.9  | queueWaitTime | int    | 队列等待时长（秒）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| 2.10 | ivrCallTime   | int    | IVR通话时长(秒)。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| 2.11 | ackTime       | int    | 应答时长(秒)。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 2.12 | callTime      | int    | 通话时长(秒)。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 2.13 | releaseCause  | int    | 呼叫释放原因码，请参见[呼叫释放原因码](https://support.huaweicloud.com/api-ccfs-cec/cec_07_0704.html#ZH-CN_TOPIC_0000002481273830)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 2.14 | beginTime     | string | 呼叫开始时间(预测外呼，预占用外呼时才有值) 格式：yyyy-MM-dd HH:mm:ss                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| 2.15 | endTime       | string | 呼叫结束时间(预测外呼，预占用外呼时才有值) 格式：yyyy-MM-dd HH:mm:ss                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 2.16 | result        | string | 呼叫结果(预测外呼，预占用外呼时才有值) "0000"：OBS转自动前呼出成功 "0900"：OBS转人工前呼出成功 "0101"：呼出失败 "-1"：标识当前的任务没有号码可呼 "0601"：退回 |
| 2.17 | resultCode    | string | 呼叫结果码(预测外呼，预占用外呼时才有值) 失败的原因码对应的外显结果码。外显结果码可以自定义，失败原因码与外显结果码相互关联                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| 2.18 | busiResult    | string | 外呼业务结果编码(预测外呼，预占用外呼时才有值) isales前台页面配置，如何配置请参见操作指南                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| 2.19 | busiSubStatus | string | 外呼业务结果子状态编码(预测外呼，预占用外呼时才有值) isales前台页面配置，如何配置请参见操作指南                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   
#### 样例报文
- 请求头：
  ```
  Content-Type: application/json;charset=UTF-8
  Authorization: ******************
  ```
  
- 请求参数：
  ```
  {
      "queryParam":
      {
          "ccId":1, 
          "isCallin":"true", 
          "callId":"1000000000-0001"
      }
  }
  ```
  

- 响应参数：
  ```
  {
      "result": "0",
      "resultCode": "0100000",
      "resultDatas": {
          "vdn": 1,
          "callId": "1000000000-0001",
          "callerNo": "10000",
          "calleeNo": "10001",
          "callType": 0,
          "agentId ": 100,
          "skillId": 1,
          "anonyCall": 0,
          "queueWaitTime": 10,
          "ivrCallTime": 0,
          "ackTime": 5,
          "callTime": 30,
          "releaseCause": 0
      },
      "resultDesc": {
          "vdn": 1,
          "callId": "1000000000-0001",
          "callerNo": "10000",
          "calleeNo": "10001",
          "callType": 0,
          "agentId ": 100,
          "skillId": 1,
          "anonyCall": 0,
          "queueWaitTime": 10,
          "ivrCallTime": 0,
          "ackTime": 5,
          "callTime": 30,
          "releaseCause": 0
      }
  }
  ```
  
 
