
# 查询指定VDN下的座席休息情况
#### 场景描述
查询指定VDN下的所有座席休息情况
#### 接口方法
设置成"POST"。该接口仅支持POST方法，不支持PUT、GET和DELETE等方法。
#### 内部封装接口
BMS接口：
- /ccbms/ws/monitor/teamrestinfo
- /ccbms/ws/monitor/teamrestagentinfo
- /ccbms/ws/monitor/agentstatusinfobyagentids
 
#### 请求URL
https://ip:port/rest/cmsapp/v1/openapi/vdn/queryagentreststate
其中，公有云环境请联系管理员获取，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  | vdn    | int  | True | 虚拟呼叫中心编号。 取值范围：1～5000                                                     |
| 3  | limit  | int  | True | 表示每页的查询数量。 取值范围：1～1000                                                      |
| 4  | offset | int  | True | offset用于确定查询的起始页offset取值公式为：offset=limit\*(page-1)，取值范围：\>=0 page为需要查询的起始页。 |
   
#### 响应说明
表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及其之前版本接口响应参数使用。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| 4  | resultDesc  | object | 查询成功后，返回结果信息的对象。 该对象中的参数说明请参见[表4]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 5  | count       | int    | 当前查询VDN下座席总数。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
 表4resultDesc/resultDatas对象参数说明 
| 序号  | 名称                | 参数类型  | 说明                                                                                                                                 |
|:---|:---|:---|:---|
| 2.1 | onRestAgentNum    | int   | 正在休息人数。                                                                                                                            |
| 2.2 | allowRestAgentNum | int   | 已经允许休息人数，但是座席仍然未休息的座席人数。                                                                                                           |
| 2.3 | waitRestAgentNum  | int   | 申请休息人数。                                                                                                                            |
| 2.4 | details           | Array | 座席休息详情，该对象数组的参数说明具体见[表5]。 |
| 说明： **当前响应结果为limit和offset分页入参条件下获取的座席休息数据** 例如：limit：10 ，offset：10 表示入参获取第二页（10个/页）的10个座席，再统计这十个座席中的休息态数据 ||||
   
 表5座席休息详情 
| 序号    | 名称              | 参数类型   | 媒体类型描述                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| 2.4.1 | agentId         | int    | 座席工号。                                                                                                                                                                                                                                                  |
| 2.4.2 | cantRestCause   | int    | 座席不允许休息的原因，此参数仅对于等待休息的座席有效。 该对象的参数说明请参见[表6] |
| 2.4.3 | vdnId           | int    | 虚拟呼叫中心编号。                                                                                                                                                                                                                                              |
| 2.4.4 | ccId            | int    | 呼叫中心编号。                                                                                                                                                                                                                                                |
| 2.4.5 | beginTime       | long   | 开始时间（若正在休息指休息开始时间，若还未休息指申请或批准休息开始时间），时间格式：时间戳。                                                                                                                                                                                                         |
| 2.4.6 | applyRestLength | int    | 申请休息时长（单位：秒）。                                                                                                                                                                                                                                          |
| 2.4.7 | name            | String | 座席姓名。                                                                                                                                                                                                                                                  |
| 2.4.8 | reqRestDura     | long   | 休息持续时长（正在休息的座席已经休息的时长），单位：秒                                                                                                                                                                                                                            |
| 2.4.9 | skillIds        | String | 等待休息的座席签入的技能队列，仅当cantRestCause等于4时才有值返回。                                                                                                                                                                                                               |
   
 表6不允许休息原因 
| 不允许休息原因值 | 如何理解              |
|:---|:---|
| 0        | 等待批准              |
| 1        | 座席示忙              |
| 2        | VDN 休息人数已满。       |
| 3        | 座席不接来话，未签入任何技能队列。 |
| 4        | 签入队列休息人数已满。       |
   
#### 样例报文
- 请求头：
  ```
  Content-Type: application/json;charset=UTF-8
  Authorization: ******************
  ```
  
- 请求参数：
  ```
  {
      "ccId":1, 
      "vdn":170,
      "offset":0,
      "limit":3
  }
  ```
  
- 响应参数：
  ```
  {
      "result": "0",
      "resultCode": "0100000",
      "resultDatas": {
          "onRestAgentNum": 2,
          "allowRestAgentNum": 0,
          "details": [
              {
                  "agentId": 1034,
                  "cantRestCause": 2,
                  "vdnId": 170,
                  "ccId": 1,
                  "beginTime": 1602830642000,
                  "applyRestLength": 600,
                  "name": "zhang1130user"
              },
              {
                  "agentId": 1039,
                  "cantRestCause": 0,
                  "vdnId": 170,
                  "ccId": 1,
                  "beginTime": 1602830613000,
                  "applyRestLength": 600,
                  "name": "HW285601039",
                  "reqRestDura": 238
              },
              {
                  "agentId": 1099,
                  "cantRestCause": 0,
                  "vdnId": 170,
                  "ccId": 1,
                  "beginTime": 1602830638000,
                  "applyRestLength": 600,
                  "name": "HW285601099",
                  "reqRestDura": 213
              }
          ],
          "waitRestAgentNum": 1
      },
      "resultDesc": {
          "onRestAgentNum": 2,
          "allowRestAgentNum": 0,
          "details": [
              {
                  "agentId": 1034,
                  "cantRestCause": 2,
                  "vdnId": 170,
                  "ccId": 1,
                  "beginTime": 1602830642000,
                  "applyRestLength": 600,
                  "name": "zhang1130user"
              },
              {
                  "agentId": 1039,
                  "cantRestCause": 0,
                  "vdnId": 170,
                  "ccId": 1,
                  "beginTime": 1602830613000,
                  "applyRestLength": 600,
                  "name": "HW285601039",
                  "reqRestDura": 238
              },
              {
                  "agentId": 1099,
                  "cantRestCause": 0,
                  "vdnId": 170,
                  "ccId": 1,
                  "beginTime": 1602830638000,
                  "applyRestLength": 600,
                  "name": "HW285601099",
                  "reqRestDura": 213
              }
          ],
          "waitRestAgentNum": 1
      },
      "count": 30
  }
  ```
  
 
