
# 统计当日外呼数据
#### 前置条件
已经申请了开发者账号。
#### 场景描述
调用该接口统计当日的外呼数据。
当日数据直接取自t_isl_daily_call表。
当日数据根据租户时区的时间计算当日并统计。
#### 接口方法
该接口仅支持GET方法。
#### 接口URL
https://ip:port/rest/isales/v2/openapi/campaigns/{vdnId}/statistics?campaignId={campaignId}\&batchId={batchId}
其中，ip为CC-iSales服务器地址，port为CC-iSales服务器的HTTPS端口号。
表1URL中携带的参数说明 
| 序号 | 参数名        | 参数类型   | 是否必选                       | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|:---|:---|
| 1  | vdnId      | int    | True                       | 虚拟呼叫中心ID。 取值的类型为整数，取值范围为1～9999。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 2  | campaignId | String | False                      | 外呼活动ID - 该参数有值，查询当前任务的全量和所有批次。  - 该参数为空时，查询所有任务的全量和所有批次。   |
| 3  | batchId    | String | False，该字段有值，则campaignId必传。 | 批次号，映射t_isl_data表customField字段。 该参数有值时，查询当前任务的全量和所传批次。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   
#### 请求说明
表2请求消息头参数 
| 序号 | 名称            | 参数类型   | 是否必选  | 说明                                                                                                                            |
|:---|:---|:---|:---|:---|
| 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)。 |
| 3  | locale        | String | False | i18n（internationalization，国际语言代码），如zh_CN表示中文、en_US表示英文等，默认zh_CN。                                                              |
   
#### 响应说明
表3消息体参数说明 
| 序号 | 参数名         | 参数类型  | 说明                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| 1  | countDetail | Array | 返回每个任务的数量。 具体见[表4] |
   
 表4countDetail结构 
| 序号   | 参数名                | 参数类型   | 说明                                                                                                                                                                                                                                                                    |
|:---|:---|:---|:---|
| 1.1  | campaignId         | String | 外呼数据ID。                                                                                                                                                                                                                                                               |
| 1.2  | unCallCount        | int    | 该活动ID下的剩余未拨打总量。                                                                                                                                                                                                                                                       |
| 1.3  | calledCount        | int    | 当天已拨打量。                                                                                                                                                                                                                                                               |
| 1.4  | finishCount        | int    | 已完成呼叫总量                                                                                                                                                                                                                                                               |
| 1.5  | batchDetail        | Array  | 返回每个customField(批次号)值的数量 具体见[表 batchDetail结构]。 |
| 1.6  | totalCalledCount   | int    | 该活动已拨打总量                                                                                                                                                                                                                                                              |
| 1.7  | totalCallSucc      | int    | 该活动接通呼叫总量                                                                                                                                                                                                                                                             |
| 1.8  | totalFinishCount   | int    | 该活动已完成呼叫总量                                                                                                                                                                                                                                                            |
| 1.9  | totalCount         | int    | 该活动总呼叫量（含完成，呼叫中，未呼叫）                                                                                                                                                                                                                                                  |
| 1.10 | dailyCalledCount   | int    | 当天已拨打量                                                                                                                                                                                                                                                                |
| 1.11 | dailyCallSucc      | int    | 当天接通呼叫总量                                                                                                                                                                                                                                                              |
| 1.12 | dailyFinishCount   | int    | 当天已完成呼叫总量                                                                                                                                                                                                                                                             |
| 1.13 | dailyCount         | int    | 当天呼叫量（含完成，呼叫中，未呼叫）                                                                                                                                                                                                                                                    |
| 1.14 | dialCount          | int    | 该活动号码拨打总次数                                                                                                                                                                                                                                                            |
| 1.15 | dialSuccCount      | int    | 该活动号码拨打成功次数                                                                                                                                                                                                                                                           |
| 1.16 | dialSuccRate       | String | 该活动号码拨打成功率                                                                                                                                                                                                                                                            |
| 1.17 | dailyDialCount     | int    | 当天号码拨打总次数                                                                                                                                                                                                                                                             |
| 1.18 | dailyDialSuccCount | int    | 当天号码拨打成功次数                                                                                                                                                                                                                                                            |
| 1.18 | dailyDialSuccRate  | String | 当天号码拨打成功率                                                                                                                                                                                                                                                             |
   
 表5batchDetail结构 
| 序号     | 参数名                | 参数类型   | 说明                                                                                                                                      |
|:---|:---|:---|:---|
| 1.5.1  | batchId            | String | 代表增加外呼数据时的批次id。 取值与customField一致。 |
| 1.5.2  | unCallCount        | int    | 该活动ID下的剩余未拨打总量。                                                                                                                         |
| 1.5.3  | calledCount        | int    | 当天已拨打量。                                                                                                                                 |
| 1.5.4  | finishCount        | int    | 已完成呼叫总量                                                                                                                                 |
| 1.5.5  | totalCalledCount   | int    | 该活动已拨打总量                                                                                                                                |
| 1.5.6  | totalCallSucc      | int    | 该活动接通呼叫总量                                                                                                                               |
| 1.5.7  | totalFinishCount   | int    | 该活动已完成呼叫总量                                                                                                                              |
| 1.5.8  | totalCount         | int    | 该活动总呼叫量（含完成，呼叫中，未呼叫）                                                                                                                    |
| 1.5.9  | dailyCalledCount   | int    | 当天已拨打量                                                                                                                                  |
| 1.5.10 | dailyCallSucc      | int    | 当天接通呼叫总量                                                                                                                                |
| 1.5.11 | dailyFinishCount   | int    | 当天已完成呼叫总量                                                                                                                               |
| 1.5.12 | dailyCount         | int    | 当天呼叫量（含完成，呼叫中，未呼叫）                                                                                                                      |
| 1.5.13 | dialCount          | int    | 该活动号码拨打总次数                                                                                                                              |
| 1.5.14 | dialSuccCount      | int    | 该活动号码拨打成功次数                                                                                                                             |
| 1.5.15 | dialSuccRate       | String | 该活动号码拨打成功率                                                                                                                              |
| 1.5.16 | dailyDialCount     | int    | 当天号码拨打总次数                                                                                                                               |
| 1.5.17 | dailyDialSuccCount | int    | 当天号码拨打成功次数                                                                                                                              |
| 1.5.18 | dailyDialSuccRate  | String | 当天号码拨打成功率                                                                                                                               |
   
#### 触发事件
无
#### 错误结果码
表6错误原因码说明 
| 序号 | 错误码      | 说明                       |
|:---|:---|:---|
| 1  | 0200001  | 参数异常，异常详情在resultDesc中描述。 |
| 2  | 02000001 | 参数值为空                    |
| 3  | 02000002 | 参数包含非法字符                 |
| 4  | 02000003 | 参数长度不能大于规定长度             |
| 5  | 02000004 | 参数长度不能小于规定长度             |
| 6  | 02000005 | 参数长度需要介于规定长度之间           |
| 7  | 02000006 | 参数值类型不正确                 |
| 8  | 02000007 | 参数值大小不正确                 |
| 9  | 02000008 | 参数转换异常，请检查请求参数           |
| 10 | 02000009 | 参数组合不正确，请检查请求参数          |
| 11 | 02000010 | hour和minute必须同时存在        |
| 12 | 02000011 | 参数个数不能大于规定个数             |
   
![](https://support.huaweicloud.com/api-ccfs-cec/public_sys-resources/caution_3.0-zh-cn.png)
接口配置流控，五分钟执行一次，针对429状态，提示返回："请勿频繁操作，请稍后再试。"。ValidateExceptionHandler中正在处理。
#### 报文样例
- 该接口的请求消息体举例如下： 无
  
- 该接口的响应消息体举例如下：
  ```
  {
    "countDetail": [
      {
        "calledCount": 0,
        "batchDetail": [],
        "campaignId": "1798316116",
        "finishCount": 0,
        "unCallCount": 0,
        "totalCount": 3,
        "totalCallSucc": 2,
        "totalCalledCount": 3,
        "totalFinishCount": 3,
        "dailyFinishCount": 3,
        "dailyCalledCount": 3,
        "dailyCallSucc": 2,
        "dailyCount": 3
      },
      {
        "calledCount": 0,
        "batchDetail": [
          {
            "calledCount": 0,
            "finishCount": 0,
            "unCallCount": 1,
            "batchId": "123456",
           "totalCount": 3,
           "totalCallSucc": 2,
           "totalCalledCount": 3,
           "totalFinishCount": 3,
           "dailyFinishCount": 3,
           "dailyCalledCount": 3,
           "dailyCallSucc": 2,
           "dailyCount": 3
          },
          {
            "calledCount": 0,
            "finishCount": 0,
            "unCallCount": 1,
            "batchId": "66666",
            "totalCount": 3,
            "totalCallSucc": 2,
           "totalCalledCount": 3,
           "totalFinishCount": 3,
           "dailyFinishCount": 3,
           "dailyCalledCount": 3,
           "dailyCallSucc": 2,
           "dailyCount": 3
          }
        ],
        "campaignId": "1549589640",
        "finishCount": 0,
        "unCallCount": 3
      }
    ]
  }
  ```
  
 
