
# 批量查询座席信息
#### 场景描述
批量查询指定座席的信息。
#### 接口方法
设置成"POST"。该接口仅支持POST方法，不支持PUT、GET和DELTE等方法。
#### 内部封装接口
CTI3.6: BMS接口：/ccbms/ws/monitor/agentstatusinfobyagentids
CTI3.8: BMS接口：/ccbms/ws/monitor/queryAgentStatusEx3Message
#### 请求URL
https://ip:port/rest/cmsapp/v1/openapi/agentgroup/agentstatusinfobyagentids
其中，公有云环境请联系管理员获取，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  | agentIds | array | True | 座席工号的数组，数组最大长度为6000。 取值范围：101-59999和70000-999999 |
   
#### 响应消息
表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 | array  | 查询成功后，返回结果信息的对象数组。 该数组中对象的参数说明请参见[表4]。 说明： 当前字段为兼容8.13及其之前版本接口响应参数使用。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| 2  | resultDesc  | array  | 查询成功后，返回结果信息的对象数组。 该数组中对象的参数说明请参见[表4]。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
 表4resultDesc/resultDatas对象参数说明 
| 序号   | 名称                    | 参数类型 | 说明                                                                                                                                                                                                                                                                           |
|:---|:---|:---|:---|
| 2.1  | agentId               | int  | 座席工号。                                                                                                                                                                                                                                                                        |
| 2.2  | locationId            | int  | 所属分布式接入节点                                                                                                                                                                                                                                                                    |
| 2.3  | currentStateReason    | int  | 当前状态原因，目前只有在休息态时才有意义                                                                                                                                                                                                                                                         |
| 2.4  | prevState             | int  | 前一个状态，参数说明请参考[CTI平台座席状态码参考](https://support.huaweicloud.com/api-ccfs-cec/cec_07_0697.html#ZH-CN_TOPIC_0000002513073729)。                                                                                                                                                     |
| 2.5  | prevStateTime         | long | 前一个状态持续时间 单位秒（s）。                                                                                                                                                                                                                                                            |
| 2.6  | currentState          | int  | 当前状态，参数说明请参考[CTI平台座席状态码参考](https://support.huaweicloud.com/api-ccfs-cec/cec_07_0697.html#ZH-CN_TOPIC_0000002513073729)。                                                                                                                                                      |
| 2.7  | currentStateTime      | long | 当前状态持续时间 单位秒（s）。                                                                                                                                                                                                                                                             |
| 2.8  | logonTime             | long | 签入时间（毫秒级时间戳） 说明： 如果查询结果中涉及的座席处于未签入状态，该字段显示的时间是未来时间（2106年），不是座席实际签入的时间。 |
| 2.9  | agentRelease          | int  | 座席主动收线次数                                                                                                                                                                                                                                                                     |
| 2.10 | currentPrivateCallNum | int  | 座席当前的私有呼叫数目                                                                                                                                                                                                                                                                  |
   
#### 样例报文
- 请求头：
  ```
  Content-Type: application/json;charset=UTF-8
  Authorization: ******************
  ```
  
- 请求参数：
  ```
  {
      "ccId":1,
      "vdn":170,
      "agentIds":[1031,1099]
  }
  ```
  
- 响应参数：
  ```
  {
      "result": "0",
      "resultCode": "0100000",
      "resultDatas": [
          {
              "prevState": 1,
              "agentId": 1031,
              "logonTime": 4294967295000,
              "agentRelease": 0,
              "locationId": 65535,
              "currentPrivateCallNum": 0,
              "currentStateTime": 2224439,
              "currentStateReason": 65535,
              "prevStateTime": 4294967295,
              "currentState": 0
          },
          {
              "prevState": 1,
              "agentId": 1099,
              "logonTime": 4294967295000,
              "agentRelease": 0,
              "locationId": 65535,
              "currentPrivateCallNum": 0,
              "currentStateTime": 230703,
              "currentStateReason": 258,
              "prevStateTime": 4294967295,
              "currentState": 0
          }
      ],
      "resultDesc": [
          {
              "prevState": 1,
              "agentId": 1031,
              "logonTime": 4294967295000,
              "agentRelease": 0,
              "locationId": 65535,
              "currentPrivateCallNum": 0,
              "currentStateTime": 2224439,
              "currentStateReason": 65535,
              "prevStateTime": 4294967295,
              "currentState": 0
          },
          {
              "prevState": 1,
              "agentId": 1099,
              "logonTime": 4294967295000,
              "agentRelease": 0,
              "locationId": 65535,
              "currentPrivateCallNum": 0,
              "currentStateTime": 230703,
              "currentStateReason": 258,
              "prevStateTime": 4294967295,
              "currentState": 0
          }
      ]
  }
  ```
  
 
