
# 座席签入平台接口
![](https://support.huaweicloud.com/api-ccfs-cec/public_sys-resources/note_3.0-zh-cn.png)
座席只签入CCS，不签入媒体服务器，不会占用license。
#### 前置条件
- 无
 
#### 接口描述
座席签入。座席只签入CCS（开启语音通话），不签入媒体服务器，不会占用license。
#### 接口方法
设置成"PUT"。该接口仅支持PUT方法，不支持POST、GET和DELETE等方法。
#### 接口URI
https://ip:port/agentgateway/resource/onlineagent/{agentid}/loginex
其中，如果CC-Gateway单机部署，IP地址为CC-Gateway服务器地址，port为CC-Gateway服务器的HTTPS端口号；如果CC-gateway采用集群模式部署，IP请配置为生产站点的NSLB地址， Port请配置为默认值8043。
表1URI中携带的参数说明 
| 序号 | 参数名     | 数据类型   | 选取原则 | 说明                     |
|:---|:---|:---|:---|:---|
| 1  | agentid | string | True | 座席的工号，取值范围：101～999999。 |
   
#### 日志中的方法名
loginEx
#### 请求说明
- 消息头
  表2请求头参数说明 
  | 序号 | 名称           | 参数类型   | 是否必选 | 说明                                          |
  |:---|:---|:---|:---|:---|
  | 1  | Content-Type | string | True | 消息主体编码方式，缺省值：application/json;charset=UTF-8 |
     
  

- 消息体
  表3消息体参数说明 
  | 序号 | 名称            | 参数类型    | 是否必选  | 说明                                                                                                                                                                                                                                                                                                                                     |
  |:---|:---|:---|:---|:---|
  | 1  | password      | string  | True  | 座席密码（最大长度为32，可为空）。                                                                                                                                                                                                                                                                                                                     |
  | 2  | phonenum      | string  | False | 座席电话（最大长度为24）                                                                                                                                                                                                                                                                                                                          |
  | 3  | autoanswer    | boolean | False | 是否自动应答，默认为true。                                                                                                                                                                                                                                                                                                                        |
  | 4  | autoenteridle | boolean | False | 是否自动进入空闲态，默认为true。                                                                                                                                                                                                                                                                                                                     |
  | 5  | releasephone  | boolean | False | 座席挂机后是否进入非长通态(呼叫结束后话机挂断)：默认为true。                                                                                                                                                                                                                                                                                                      |
  | 6  | agenttype     | int     | False | 签入的座席类型，默认为4。4：pc+phone座席，11：pc+phone视频座席                                                                                                                                                                                                                                                                                              |
  | 7  | status        | int     | False | 签入后的状态，默认为空闲态。 3：示忙 4：空闲 5：整理态 |
  | 8  | ip            | string  | False | 座席ip，默认127.0.0.1（最大长度为15），暂不支持IPV6                                                                                                                                                                                                                                                                                                     |
  | 9  | entryIp       | string  | False | 座席客户端应用网关IP                                                                                                                                                                                                                                                                                                                            |
  | 10 | phonelinkage  | boolean | False | 是否启动话机联动（接续和硬话机联动控制）。 默认为false。                                                                                                                                                                                                     |
  | 11 | checkInWebm   | boolean | False | 是否签入Webm媒体服务器。 默认为true。                                                                                                                                                                                                             |
  | 12 | checkInMailm  | boolean | False | 是否签入Mailm媒体服务器。 默认为false。                                                                                                                                                                                                           |
  | 13 | vcPhoneNumber | string  | False | VC号码（最大长度为24）                                                                                                                                                                                                                                                                                                                          |
  | 14 | listenStatus  | boolean | False | 质检员是否侦听座席登录和登出的操作。 默认为false。                                                                                                                                                                                                       |
     
  
 
#### 响应说明
表4消息体参数说明 
| 序号 | 名称      | 参数类型   | 说明                                                                                                                                                                                                                                            |
|:---|:---|:---|:---|
| 1  | message | string | 描述                                                                                                                                                                                                                                            |
| 2  | retcode | string | 错误码。取值如下： 0：成功 非0：失败                  |
| 3  | result  | Map    | 查询成功后，返回结果信息的对象。 该对象的参数说明请参见[表5]。 |
   
 表5result对象参数说明 
| 序号  | 名称            | 参数类型   | 说明                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| 3.1 | vdnid         | string | 虚拟呼叫中心ID。                                                                                                                                                                                                                                                                                                                                                                                 |
| 3.2 | workno        | string | 座席工号。                                                                                                                                                                                                                                                                                                                                                                                     |
| 3.3 | mediatype     | string | 签入媒体服务器是否成功，T表示成功，F表示失败，三位分别表示CTIServer、WebM、MailM。只有签入CTIServer成功，才能进行语音业务处理；只有签入WebM成功，才能进行文字交谈业务处理；当前不支持签入MailM。                                                                                                                                                                                                                                                                       |
| 3.4 | loginTime     | string | 签入时间                                                                                                                                                                                                                                                                                                                                                                                      |
| 3.5 | isForceChange | string | 是否需要强制修改密码，如果为true，则座席登录后，必须修改密码。 说明： 如果为false有安全风险，请谨慎使用，建议使用true，表示下次登录必须修改密码。                                                                                                      |
| 3.6 | serverName    | string | 登录的CC-Gateway的集群名称。                                                                                                                                                                                                                                                                                                                                                                       |
| 3.7 | timeRemaining | string | 密码剩余过期时间。 空字符串则表示座席密码永不过期。取值范围为0\~180（天）。 说明： 空字符串有安全风险，请谨慎使用，建议设置取值范围内的值，保证定期修改密码。 |
   
#### 触发事件
如果签入时status参数设置3（示忙态），触发如下事件：
- 座席开始执行签入动作（AgentOther_InService）
- 示闲（AgentState_Ready）
- 示忙成功（AgentState_SetNotReady_Success）
如果签入时status参数设置4（空闲态），触发如下事件
- 座席开始执行签入动作（AgentOther_InService）
- 示闲（AgentState_Ready）
如果签入时status参数设置5（整理态），触发如下事件：
- 座席开始执行签入动作（AgentOther_InService）
- 示闲（AgentState_Ready）
- 工作中（AgentState_Work）
 
#### 错误结果码
- 100-001
- 100-002
- 100-003
- 100-004
- 100-007
- 100-012
- 100-015
- 100-016
- 110-016
- 999-001
 
#### 报文样例
- 消息头
  ```
  Content-Type:application/json;charset=UTF-8
  Guid：xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.AgentGateway1
  ```
  
- 请求参数
  ```
  {
      "password": "",
      "phonenum": "40038",
      "status": "4",
      "releasephone": "false",
      "agenttype": "4"
  }
  ```
  
- 响应参数
  ```
  {
      "message": "",
      "retcode": "0",
      "result": {
          "vdnid": 1,
          "workno": "291",
          "mediatype": "TTF",
          "loginTime": "1471585949806",
          "isForceChange": "false",
          "serverName": "AgentGateway",
          "timeRemaining": "9"
      }
  }
  ```
  
 
