====== API开放平台 ====== ===== 概述 ===== 环信客服云API开放平台以REST API的方式向第三方系统提供服务端调用的接口,用于业务系统对接和流程自动化等场景。目前,我们提供了坐席管理和历史会话相关的API,后续会根据客户需求逐步提供更丰富的接口,方便您的使用。 API开放平台为旗舰版功能。 ===== 获取clientID和secretID ===== 开通了API开放平台的每个租户,环信会提供用于认证的clientID和secretID。在调用平台的接口前,需要根据clientID和secretID生成accessToken,并将accessToken放在调用接口的请求头中使用。 注:请联系环信获取租户对应的clientID和secretID。 ===== 获取accessToken ===== 根据clientID和secretID生成accessToken。获取到accessToken后,即可以正常调用平台接口。 重要提醒:获取的accessToken在2小时之内有效,由于网络延迟等原因,系统不保证accessToken在此值表示的有效期内绝对有效,如果发现accessToken使用异常请重新获取新的accessToken。 * Path:http://kefu.easemob.com/api/platform/tenants/{tenantId}/accessToken * HTTP Method:POST * Request Headers: Content-Type=application/json * 可能的错误码:API_003(租户ID错误),API_004(clientId或secretId不正确)。详见:[[#错误码说明|错误码说明]] Request body: { "tenantId":"租户ID", "clientId":"8340a6d8-211f-4b81-9202-63ce46f27c02", "secretId":"ca906984-80f1-41b0-a272-6000df3f76c4" } **Curl示例:** curl -X POST \ http://kefu.easemob.com/api/tenant/1/accessToken \ -H 'Content-Type: application/json' \ -d '{ "clientId":"8340a6d8-211f-4b81-9202-63ce46f27c02", "secretId":"ca906984-80f1-41b0-a272-6000df3f76c4" }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |clientId| String |Y|租户的唯一标识码,联系环信获取| |secretId| String |Y|租户的授权码,联系环信获取| **Response示例:** { "status": "OK", "entity": { "accessToken": "4313913457bfd684eccbbb7405ba074f", "expireTime": 7200 } } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| |accessToken| String |token| |expireTime|integer|过期时间(单位:秒)| ===== 创建关联 ===== 可调用接口创建关联,关联即im消息通道。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/autoCreateImAssociation * HTTP Method: POST * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --location --request POST 'localhost:8016/api/platform/tenants/20016/autoCreateImAssociation' \ --header 'Content-Type: application/json' \ --data-raw '{ "associationName":"6666" 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |associationName|String|N|关联名称| **Response示例:** { "status": "OK", "entity": { "id": 23597, "tenantId": 29748, "name": "6666", "description": null, "orgName": "1428201012025562", "appName": "kefuchannelapp29748", "clientId": "YXA6W8LnQAxXEeuh8wWPzpsadg", "clientSecret": "YXA6wc3HKZZvXVlSl2M5arIpqLqqV_A", "serviceEaseMobIMNumber": "kefuchannelimid_600643", "serviceEaseMobIMPassword": null, "createDateTime": 1607959692553, "ispass": true, "isrun": true, "dutyType": "None", "agentQueueId": null, "secondQueueId": null, "robotId": null, "secondRobotId": null, "timeScheduleId": 0, "usermail": "d938ebd9-86cb-4b89-8c12-54121b491c36@easemob.com", "password": null, "token": null, "techChannelInfo": null, "experience": false, "appKey": "1428201012025562#kefuchannelapp29748" } } 参数说明: ^名称^类型^说明^ | status | String | 接口响应状态 | |id | int | 关联ID | |tenantId | int | 租户ID | |name | String | 关联名称 | | description | String | 描述 | | orgName | String | | | appName | String | 应用名称 | | clientId | String | | | clientSecret | String | 秘钥 | | serviceEaseMobIMNumber | String | 环信IM账号 | | ServiceEaseMobIMpassword | String | 环信IM密码 | | createDateTime | Data | 创建时间 | | ispass | boolean | | | isrun | boolean | | | dutyType | DutyType | 绑定是全天还是分上下班(枚举:Allday(全天)、Onoff(上班时段和下班时段)、None(空)、NonWorkHours(下班时间)、WorkHours(上班时间)) | | agentQueueId | long | 上班时间或全天绑定的技能组id | | secondQueueId | long | 下班时间绑定的技能组id | | robotId | long | 上班时间或全天绑定的机器人id | | secondRobotId | long | 下班时间绑定的机器人id | | timeScheduleId | int | 时间计划 | | usermail | String | 邮箱(随机生成) | | password | String | 密码(随机生成) | | token | String | | | techChannelInfo | String | | | experience | | | appKey | | ===== 管理坐席 ===== ==== 查询坐席信息 ==== 可根据坐席的邮箱、真实姓名、手机号码、工号,对坐席进行模糊查询。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/agents * HTTP Method: GET * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl -X GET \ 'http://kefu.easemob.com/api/platform/tenants/1/agents?&agentType=Message' \ -H 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |page|int|Y|第几页,从0开始| |size|int|Y|每页显示的数据| |keyValue|String|Y|模糊查询,username(邮箱),trueName(真实姓名)| |agentType|String|N|坐席类型:All 全渠道座席,Message 在线座席,Ticket 工单座席,CallCenter 呼叫中心座席, MVCombine 视频客服(VEC独立视频),默认为全部| **Response示例:** { "status": "OK", "entities": [ { "tenantId": 1, "userId": "43efaf15-ef51-4a3c-a961-560ca59b7c29", "userType": "Agent", "userScope": "Tenant", "password": "", "username": "32273591@qq.com", "roles": "admin,agent", "createDateTime": "2018-06-10 14:19:41", "lastUpdateDateTime": "2018-06-10 16:44:47", "status": "Enable", "state": "Offline", "maxServiceSessionCount": 10, "trueName": "", "mobilePhone": "", "agentType": "Message", "roleList": [ { "role_id": 1, "role_name": "admin" } ], "avatar": "//sandbox.kefu.easemob.com/v1/tenants/28811/mediafiles/25763dd6-3b84-43ac-9471-869ec33bc91e5aS05YOPLnBuZw==/cutout?arg=0_0_1024_1024_300_300 \t", "scope": "Tenant", "bizId": "1", "onLineState": "Offline", "currentOnLineState": "Offline" } ], "first": true, "last": false, "size": 10, "number": 0, "numberOfElements": 1, "totalPages": 11, "totalElements": 1 } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| | tenantId | int |租户ID| | userId | String | 坐席ID | | userType | String | 坐席类型 | | userScope | String | 所属范围 | | password | String | 密码 | | username | String | 账号(邮箱) | | roles | String | 角色 | | createDateTime | String | 创建时间 | | lastUpdateDateTime | String | 更新时间 | | status | String | 启用状态 | | state | String | 在线与离线状态,在线状态Online包含有:Idle(空闲)、Busy(忙碌)、Hidden(隐身)、Leave(离开) ,离线状态Offline包含有:Offline(离线)、Logout(登出) | | maxServiceSessionCount | int |接待人数| | trueName | String |真实姓名| | mobilePhone | String |电话号码| | agentType | String | 坐席类型 | | (roleList) role_id | int |角色ID| | (roleList) role_name | String |角色名称| | avatar | String | 头像 | | scope | String | 所属范围 | | bizId | String | 所属业务ID | | onLineState | String | 在线状态,同State字段 | | currentOnLineState | String | 在线状态,同State字段 | | first | Boolean | 是否为第一页 是:true 否:false | | last | Boolean | 是否为最后一页 是:true 否:false | | size | int |每页显示的数据| | number | int | 第几页,从0开始 | | numberOfElements | int | 当前页面有多少条记录 | | totalPages | int | 一共有多少页 | | totalElements | int | 一共有多少条记录 | ==== 添加坐席 ==== 添加坐席,并设置坐席的昵称、登录邮箱、密码、真实姓名等信息。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/agent * HTTP Method: POST * Request Headers: Content-Type=application/json和Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] Request body: { "nicename":"123", "username":"32273591@qq.com", "password":"qwe12345", "trueName":"321", "agentType":"All", "mobilePhone":"", "agentNumber":"", "roleId":1, "maxServiceSessionCount":"10" } **Curl示例:** curl -X POST \ http://kefu.easemob.com/api/platform/tenants/1/agent \ -H 'Content-Type: application/json' \ -H 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ -d '{ "nicename":"123", "username":"32273591@qq.com", "password":"qwe12345", "trueName":"321", "agentType":"All", "mobilePhone":"", "agentNumber":"", "roleId":1, "maxServiceSessionCount":"10" }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |nicename| String |Y|坐席的昵称| |username| String |Y|账号(邮箱)| |password| String |Y|密码| |trueName| String |Y|真实姓名| |agentType| String |N|坐席类型:All 全渠道座席,Message 在线座席,Ticket 工单座席,CallCenter 呼叫中心座席,, MVCombine 视频客服(VEC独立视频),默认为在线坐席| |mobilePhone|int|Y|电话号码| |agentNumber|int|Y|工号| |maxServiceSessionCount|int|Y|接待人数| |roleId|int|Y|角色ID| **Response示例:** { "status": "OK", "entity": { "tenantId": 1, "userId": "f2e2a537-ea64-4d0b-8ce3-42e1b1a382be", "userType": "Agent", "userScope": "Tenant", "nicename": "123", "password": "", "username": "32273591@qq.com", "roles": "admin,agent", "createDateTime": "2018-06-13 16:42:56", "lastUpdateDateTime": "2018-06-13 16:42:56", "status": "Enable", "state": "Offline", "maxServiceSessionCount": 10, "trueName": "321", "mobilePhone": "", "agentType": "Message", "language": "zh_CN", "timeZone": "UTC+8", "scope": "Tenant", "bizId": "1", "currentOnLineState": "Offline", "onLineState": "Offline" } } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| | tenantId | int | 租户ID | | userId | String | 坐席ID | | userType | String | 坐席类型:坐席/管理员 | | userScope | String | 所属范围 | | nicename | String | 坐席的昵称 | | password | String | 密码 | | username | String | 账号(邮箱) | | roles | String | 角色 | | createDateTime | String | 创建时间 | | lastUpdateDateTime | String | 更新时间 | | status | String | 启用状态 | | state | String | 在线状态 | | maxServiceSessionCount | int | 接待人数 | | trueName | String | 真实姓名 | | mobilePhone | String | 电话号码 | | agentType | String | 坐席类型 | | language | String | 语言 | | timeZone | String | 时区 | | scope | String | 所属范围 | | bizId | String | 所属业务ID | | currentOnLineState | String | 在线状态 | | onLineState | String | 在线状态 | ==== 修改坐席 ==== 修改坐席的基本信息,包括坐席的昵称、密码、真实姓名等。 注:需正确填写坐席的登录邮箱地址(username字段)。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/agent * HTTP Method: PUT * Request Headers: Content-Type=application/json和Kefu-Token=${accessToken} * 可能的错误码:API_104(坐席不存在)。详见:[[#错误码说明|错误码说明]] Request body: { "nicename":"环环", "username":"32273591@qq.com", "trueName":"小环", "agentType":"All", "mobilePhone":"", "agentNumber":"", "roleId":1, "maxServiceSessionCount":null } **Curl示例:** curl -X PUT \ http://kefu.easemob.com/api/platform/tenants/1/agent \ -H 'Content-Type: application/json' \ -H 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ -d '{ "nicename":"环环", "username":"32273591@qq.com", "trueName":"小环", "agentType":"All", "mobilePhone":"", "agentNumber":"", "roleId":1, "maxServiceSessionCount":null }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |nicename| String |N|昵称| |username| String |Y|账号(邮箱)| |trueName| String |N|真实姓名| |agentType| String |N|坐席类型:All 全渠道座席,Message 在线座席,Ticket 工单座席,CallCenter 呼叫中心座席, MVCombine 视频客服(VEC独立视频),默认为在线坐席| |mobilePhone|int|N|电话号码| |agentNumber|int|N|工号| |maxServiceSessionCount|int|N|接待人数| |roleId|int|N|角色Id| **Response示例:** { "status": "OK" } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| ==== 获取角色 ==== 获取租户的所有角色,包括管理员、坐席、自定义角色。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/roles * HTTP Method: GET * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url http://kefu.easemob.com/api/platform/tenants/1/roles \ --header 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| **Response示例:** { "status": "OK", "entities": [ { "role_id": 1, "role_name": "admin", "role_description": "管理员", "role_type": "SYSTEM", "created_at": null, "updated_at": null, "status": "ENABLE" }, { "role_id": 2, "role_name": "agent", "role_description": "坐席", "role_type": "SYSTEM", "created_at": null, "updated_at": null, "status": "ENABLE" }, { "role_id": 3, "role_name": "123", "role_description": null, "role_type": "CUSTOMIZED", "created_at": "2018-03-23T16:02:02.000+0800", "updated_at": "2018-03-23T16:02:02.000+0800", "status": "ENABLE" }, { "role_id": 4, "role_name": "asd", "role_description": null, "role_type": "CUSTOMIZED", "created_at": "2018-06-10T18:32:37.000+0800", "updated_at": "2018-06-10T18:32:37.000+0800", "status": "ENABLE" } ] } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| | role_id | int | 角色ID | | role_name | String | 角色名称 | | role_description | String | 角色描述 | | role_type | String | 角色类型 | | created_at | String | 创建时间 | | updated_at | String | 更新时间 | | status | String | 启用状态 | ==== 修改密码 ==== 修改坐席的登录密码。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/agent/password * HTTP Method: PUT * Request Headers: Content-Type=application/json和Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] Request body: { "username":"32273591@qq.com", "password":"qwe123456" } **Curl示例:** curl -X PUT \ http://kefu.easemob.com/api/platform/tenants/1/agent/password \ -H 'Content-Type: application/json' \ -H 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ -d '{ "username":"32273591@qq.com", "password":"qwe123456" }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |username| String |Y|账号(邮箱)| |password| String |Y|新密码| **Response示例:** { "status": "OK" } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| ==== 删除坐席 ==== 删除指定的坐席。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/agent * HTTP Method: DELETE * Request Headers: Content-Type=application/json和Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] Request body: { "username":"32273591@qq.com" } **Curl示例:** curl -X DELETE \ http://kefu.easemob.com/api/platform/tenants/1/agent \ -H 'Content-Type: application/json' \ -H 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ -d '{ "username":"32273591@qq.com" }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |username| String |Y|账号(邮箱)| **Response示例:** { "status": "OK" } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| ==== 禁用坐席 ==== 禁用指定的坐席。处于禁用状态的坐席无法登录环信客服云。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/agent/disable * HTTP Method: PUT * Request Headers: Content-Type=application/json和Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] Request body: { "username":"32273591@qq.com" } **Curl示例:** curl -X PUT \ http://kefu.easemob.com/api/platform/tenants/1/agent/disable \ -H 'Content-Type: application/json' \ -H 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ -d '{ "username":"32273591@qq.com" }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |username| String |Y|账号(邮箱)| **Response示例:** { "status": "OK" } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| ==== 启用坐席 ==== 启用指定的坐席。处于启用状态的坐席可以登录环信客服云。 * Path: http://kefu.easemob.com/api/platform/platform/tenants/{tenantId}/agent/enable * HTTP Method: PUT * Request Headers: Content-Type=application/json和Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] Request body: { "username":"32273591@qq.com" } **Curl示例:** curl -X PUT \ http://kefu.easemob.com/api/platform/tenants/1/agent/enable \ -H 'Content-Type: application/json' \ -H 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ -d '{ "username":"32273591@qq.com" }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |username| String |Y|账号(邮箱)| **Response示例:** { "status": "OK" } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| ==== 修改坐席在线状态 ==== 可修改坐席在线状态,状态列表:空闲、忙碌、离开、隐身、离线。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/agent/state * HTTP Method: PUT * Request Headers: Content-Type=application/json和Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] Request body: { "username":"32273591@qq.com", "state":"Busy" } **Curl示例:** curl -X PUT \ http://kefu.easemob.com/api/platform/tenants/1/agent/state \ -H 'Content-Type: application/json' \ -H 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ -d '{ "username":"32273591@qq.com", "state":"Busy" }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |username| String |Y|账号(邮箱)| |state| String |Y|在线状态:空闲(Online),忙碌(Busy),离开(Leave),隐身(Hidden),离线(Offline)| **Response示例:** { "status": "OK" } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| ===== 管理技能组 ===== ==== 获取在线技能组列表接口 ==== **获取token** *开放平台需要使用token进行身份验证 *Kefu-Token有效期2小时,到期需重新获取。 **登录地址** ^名称^说明^ |操作| 获取在线技能组列表的接口 | |协议| HTTPS | |方式| GET | |URL| /api/platform/tenants/{tenantId}/skillgroups | ^名称^说明^ |操作| 获取指定技能组下坐席信息的接口| |协议| HTTPS| |方式| GET| |URL| /api/platform/tenants/{tenantId}/skillgroups/{queueId}| **请求参数** 1./api/platform/tenants/{tenantId}/skillgroups ^参数^是否必传^描述^参数类型^数据类型^ |tenantId| 是| 租户Id| Path| integer| |RequestParam|否|请求参数| Path| String| RequestParam包括以下几个参数: ^参数^是否必传^描述^参数类型^数据类型^ |page| 否| 当前页,默认0| String size| 否| 当前页长,默认50|String 2./api/platform/tenants/{tenantId}/skillgroups/{queueId} ^参数^是否必传^描述^参数类型^数据类型^ |tenantId| 是| 租户Id| Path| integer |queueId| 是| 技能组Id| Path| Long **返回数据** ^HTTP状态Code^含义^ |200| OK| |400| 参数不正确| ^成功返回数据^含义^ |Status| OK| |entities| List| **Entities包含返回数据** ^返回数据^含义^ |tenantId| 租户Id| |queueId| 技能组Id| |queueName| 技能组名称| |queueType| 普通队列,还是临时队列| |createDateTime| 创建时间| |lastUpdateDateTime| 上次修改时间| |queueGroupType| 技能组是默认组还是用户自定义组| |agentUsers| 坐席数据信息| **AgentUsers数据信息** ^返回数据^含义^ |tenantId| 租户Id| |userId| 用户Id| |userType| 用户类型| |userScope| 用户所属范围| |nicename| 昵称| |username| 用户名| |roles| 坐席拥有的角色| |createDateTime| 坐席创建时间| |lastUpdateDateTime| 上一次修改时间| |statu| 坐席是否启用| |state| 坐席状态:在线,忙碌,离线等| |maxServiceSessionCount| 坐席最大接待数| |agentType| 坐席类型| |scope| 所属范围| |bizId| 所属的业务Id| |onLineState| 在线状态| **请求示例** 请求数据格式都应该是application/json,编码形式为UTF-8 1.获取技能组列表数据信息请求方式 /api/platform/tenants/29762/skillgroups?page=0&size=10或 /api/platform/tenants/29762/skillgroups 2.获取技能组下坐席信息请求方式 /api/platform/tenants/29762/skillgroups/6160 **成功返回示例** 1.获取技能组列表数据信息 http://localhost:8016/api/platform/tenants/29762/skillgroups?page=0&size=10 { "status": "OK", "entities": [ { "tenantId": 29762, "queueId": 6158, "queueName": "售后", "queueType": "QueueNormal", "priority": 0, "createDateTime": 1635846909000, "lastUpdateDateTime": 1635846911000, "queueGroupType": "UserDefined", "agentUsers": null }, { "tenantId": 29762, "queueId": 6159, "queueName": "未分配", "queueType": "QueueNormal", "priority": 0, "createDateTime": 1635846957000, "lastUpdateDateTime": 1635846958000, "queueGroupType": "SystemDefault", "agentUsers": null }, { "tenantId": 29762, "queueId": 6160, "queueName": "产品", "queueType": "QueueNormal", "priority": 0, "createDateTime": 1635847007000, "lastUpdateDateTime": 1635847008000, "queueGroupType": "UserDefined", "agentUsers": null } ], "first": true, "last": true, "size": 10, "number": 0, "numberOfElements": 3, "totalPages": 1, "totalElements": 3 } 2.获取技能组下坐席信息 http://localhost:8016/api/platform/tenants/29762/skillgroups/6160 { "status": "OK", "entities": [ { "tenantId": 29762, "queueId": 6160, "queueName": "产品", "queueType": "QueueNormal", "priority": 0, "createDateTime": 1635847007000, "lastUpdateDateTime": 1635847008000, "queueGroupType": "UserDefined", "agentUsers": [ { "tenantId": 77278, "userId": "f3d51aa9-16cb-4b18-bcf7-e9365765e02f", "userType": "Agent", "userScope": "Tenant", "nicename": "Admin", "password": "", "username": "735017618@qq.com", "roles": "admin,agent", "createDateTime": "2016-10-13 15:51:14", "lastUpdateDateTime": "2016-10-13 15:52:08", "status": "Enable", "state": "Online", "maxServiceSessionCount": 10, "trueName": "Admin", "agentType": "Ticket", "scope": "Tenant", "bizId": "77278", "onLineState": "Online", "currentOnLineState": "Online" }, { "tenantId": 29762, "userId": "f3d51aa9-16cb-4b18-bcf7-e9365765e02d", "userType": "Agent", "userScope": "Tenant", "nicename": "Admin", "password": "", "username": "29762@qq.com", "roles": "admin,agent", "createDateTime": "2021-11-03 10:52:05", "lastUpdateDateTime": "2021-11-03 10:52:07", "status": "Enable", "state": "Online", "maxServiceSessionCount": 15, "agentType": "Message", "scope": "Tenant", "bizId": "29762", "onLineState": "Online", "currentOnLineState": "Online" } ] } ] } ==== 添加技能组 ==== 入参Kefu-Token和之前一样,示例中省略Kefu-Token 请求 :POST /api/platform/tenants/{tenantId}/queues 入参: ^名称^类型^是否非空(Y:是;N:否)^说明^ | tenantId |Integer| Y | 租户id | |queueType|String | Y |云呼:CallCenter,在线:Message| | name|String | Y|技能组名称 (不能超过20)| 出参: ^名称^类型^是否非空(Y:是;N:否)^说明^ |queueId|String | Y |技能组id| |queueName|String | Y |技能组名称| |queueGroupType|String | Y |技能组类型,在线用,UserDefined自定义 SystemDefault默认组| | userCount|Integer| Y | 技能组内坐席数量| **在线示例** curl --location 'localhost:8016/api/platform/tenants/77877/queues?queueType=Message' \ --header 'Content-Type: application/json' \ --data '{ "name": "zaixian8" }' { "status": "OK", "entity": { "queueId": "9", "queueName": "zaixian8", "queueGroupType": "UserDefined", "userCount": 0 } } **云呼示例** curl --location 'localhost:8016/api/platform/tenants/77877/queues?queueType=CallCenter' \ --header 'Content-Type: application/json' \ --data '{ "name": "yunhu8" }' { "status": "OK", "entity": { "queueId": "1343b9c0-9572-11ee-8fbc-f7237c60157d", "queueName": "yunhu8", "queueGroupType": null, "userCount": 0 } } ==== 查询技能组 ==== 入参Kefu-Token和之前一样,示例中省略Kefu-Token GET /api/platform/tenants/{tenantId}/queues 入参 ^名称^类型^是否非空(Y:是;N:否)^说明^ |tenantId|Integer | Y|租户id| |queueType|String | Y|云呼:CallCenter,在线:Message| | queueName|String|N |技能组名称,非必传| | page|Integer| Y|页码| | size|Integer|Y |条数| 出参 ^名称^类型^是否非空(Y:是;N:否)^说明^ | queueId|String|Y |技能组id| |queueName|String |Y |技能组名称| |queueGroupType|String |Y |技能组类型,在线用,UserDefined自定义 SystemDefault默认组| |userCount|Integer|Y |技能组内坐席数量| **在线示例** curl --location 'localhost:8016/api/platform/tenants/77877/queues?queueType=Message&queueName=2&page=0&size=2' { "status": "OK", "entities": [ { "queueId": "5", "queueName": "在线技能组1207-1", "queueGroupType": "UserDefined", "userCount": 0 } ], "first": false, "last": true, "size": 2, "number": 1, "numberOfElements": 1, "totalPages": 2, "totalElements": 3 } **云呼示例** curl --location 'localhost:8016/api/platform/tenants/77877/queues?queueType=CallCenter&queueName=yunhu&page=0&size=2' { "status": "OK", "entities": [ { "queueId": "96c24d60-94e2-11ee-a3a1-67aeafb58a22", "queueName": "yunhu5", "queueGroupType": null, "userCount": 0 }, { "queueId": "ba41de30-94e3-11ee-9f77-539178b4fcc1", "queueName": "yunhu6", "queueGroupType": null, "userCount": 0 } ], "first": true, "last": false, "number": 0, "numberOfElements": 2, "totalPages": 3, "totalElements": 5 } ==== 修改技能组 ==== 入参Kefu-Token和之前一样,示例中省略Kefu-Token 请求:PUT /api/platform/tenants/{tenantId}/queue/{queueId} 入参 ^名称^类型^是否非空(Y:是;N:否)^说明^ |tenantId|Integer |Y|租户id| |queueType|String|Y |云呼:CallCenter,在线:Message| |queueId|String | Y|技能组id| |name|String | Y|技能组名称(不能超过20)| **在线示例** curl --location --request PUT 'localhost:8016/api/platform/tenants/77877/queue/5?queueType=Message' \ --header 'Content-Type: application/json' \ --data '{ "name":"在线2222" }' { "status": "OK" } **云呼示例** curl --location --request PUT 'localhost:8016/api/platform/tenants/77877/queue/96c24d60-94e2-11ee-a3a1-67aeafb58a22?queueType=CallCenter' \ --header 'Content-Type: application/json' \ --data '{ "name":"云呼5555" }' { "status": "OK" } ==== 删除技能组 ==== 入参Kefu-Token和之前一样,示例中省略Kefu-Token 请求:DELETE /api/platform/tenants/{tenantId}/queue/{queueId} 入参 ^名称^类型^是否非空(Y:是;N:否)^说明^ |tenantId|Integer | Y|租户id| |queueType|String | Y|云呼:CallCenter,在线:Message| |queueId|String |Y |技能组id| |userId|String | Y|坐席id(是指记录操作坐席)| **在线示例** curl --location --request DELETE 'localhost:8016/api/platform/tenants/77877/queue/9?queueType=Message&userId=5e0de11f-dfa5-43f4-acc1-38ad878d6a08' { "status": "OK" } **云呼示例** curl --location --request DELETE 'localhost:8016/api/platform/tenants/77877/queue/96c24d60-94e2-11ee-a3a1-67aeafb58a22?queueType=CallCenter&userId=5e0de11f-dfa5-43f4-acc1-38ad878d6a08' { "status": "OK" } ==== 添加技能组成员 ==== 入参Kefu-Token和之前一样,示例中省略Kefu-Token 请求:POST /api/platform/tenants/{tenantId}/queue/{queueId}/agent 入参 ^名称^类型^是否非空(Y:是;N:否)^说明^ |tenantId|Integer |Y |租户id| |queueType|String | Y|云呼:CallCenter,在线:Message| |queueId|String |Y |技能组id| | userIds|String| Y|坐席id| **在线示例** curl --location 'localhost:8016/api/platform/tenants/77877/queue/3/agent?queueType=Message' \ --header 'Content-Type: application/json' \ --data '[ "5e0de11f-dfa5-43f4-acc1-38ad878d6a08" ]' { "status": "OK" } **云呼示例** curl --location 'localhost:8016/api/platform/tenants/77877/queue/e78a3de0-94cc-11ee-b500-2ba045a0f55e/agent?queueType=CallCenter' \ --header 'Content-Type: application/json' \ --data '[ "5e0de11f-dfa5-43f4-acc1-38ad878d6a08" ]' { "status": "OK" } ==== 删除技能组成员 ==== 入参Kefu-Token和之前一样,示例中省略Kefu-Token 请求:DELETE /api/platform/tenants/{tenantId}/queue/{queueId}/agent 入参: |名称|类型|是否非空(Y:是;N:否)|说明| |tenantId|Integer |Y |租户id| |queueType|String | Y|云呼:CallCenter,在线:Message| |queueId|String |Y|技能组id| |userIds|String|Y |坐席id| **在线示例** curl --location --request DELETE 'localhost:8016/api/platform/tenants/77877/queue/8/agent?queueType=Message' \ --header 'Content-Type: application/json' \ --data '[ "5e0de11f-dfa5-43f4-acc1-38ad878d6a08" ]' { "status": "OK" } **云呼示例** curl --location --request DELETE 'localhost:8016/api/platform/tenants/77877/queue/1343b9c0-9572-11ee-8fbc-f7237c60157d/agent?queueType=CallCenter' \ --header 'Content-Type: application/json' \ --data '[ "5e0de11f-dfa5-43f4-acc1-38ad878d6a08" ]' { "status": "OK" } ==== 查询技能组成员 ==== 入参Kefu-Token和之前一样,示例中省略Kefu-Token 请求:GET /api/platform/tenants/{tenantId}/queue/{queueId}/agent 入参 |名称|类型|是否非空(Y:是;N:否)|说明| |tenantId|Integer |Y |租户id| |queueType|String | Y |云呼:CallCenter,在线:Message| |queueId|String |Y |技能组id| |page|Integer |Y |页码| | size|Integer|Y |条数| 出参 |名称|类型|是否非空(Y:是;N:否)|说明| |agentUser|Agentuser | Y|坐席信息| | level|String| Y|等级值,云呼技能组用| **在线示例** curl --location 'localhost:8016/api/platform/tenants/77877/queue/8/agent?queueType=Message' { "status": "OK", "entities": [ { "agentUser": { "tenantId": 77877, "userId": "5e0de11f-dfa5-43f4-acc1-38ad878d6a08", "userType": "Agent", "userScope": "Tenant", "nicename": "123", "password": "", "username": "qu120711", "roles": "admin,agent", "createDateTime": "2023-12-07 14:39:32", "lastUpdateDateTime": "2023-12-07 14:39:32", "status": "Enable", "state": "Offline", "maxServiceSessionCount": 10, "trueName": "321", "mobilePhone": "", "agentNumber": 120711, "agentType": "All", "scope": "Tenant", "bizId": "77877", "currentOnLineState": "Offline", "onLineState": "Offline" }, "level": null } ], "first": true, "last": true, "size": 10, "number": 0, "numberOfElements": 1, "totalPages": 1, "totalElements": 1 } { "status": "OK", "entities": [], "first": true, "last": true, "size": 10, "number": 0, "numberOfElements": 0, "totalPages": 0, "totalElements": 0 } **云呼示例** curl --location 'localhost:8016/api/platform/tenants/77877/queue/1343b9c0-9572-11ee-8fbc-f7237c60157d/agent?queueType=CallCenter' { "status": "OK", "entities": [ { "agentUser": { "tenantId": 77877, "userId": "5e0de11f-dfa5-43f4-acc1-38ad878d6a08", "userType": "Agent", "userScope": "Tenant", "nicename": "123", "password": "", "username": "qu120711", "roles": "admin,agent", "createDateTime": "2023-12-07 14:39:32", "lastUpdateDateTime": "2023-12-07 14:39:32", "status": "Enable", "state": "Offline", "maxServiceSessionCount": 10, "trueName": "321", "mobilePhone": "", "agentNumber": 120711, "agentType": "All", "scope": "Tenant", "bizId": "77877", "currentOnLineState": "Offline", "onLineState": "Offline" }, "level": "5" } ], "first": true, "last": true, "number": 0, "numberOfElements": 1, "totalPages": 1, "totalElements": 1 } { "status": "OK", "entities": [], "first": true, "last": true, "number": 0, "numberOfElements": 0, "totalPages": 0, "totalElements": 0 } ===== 批量查询客户信息接口 ===== **Request body::** { "page": 0, "size": 9, "conditions": [ { "field_name": "createDateTime", "value": "time1,time2", "operation": "RANGE" } ] } 参数说明: ^名称^类型^说明^ |page | int | 页数 | |size | int | 每页条数| |conditions| | 查询条件| |field_name| |查询字段名称,访客创建时间,固定无需修改| |value String tim1||开始时间戳,time2结束时间戳| |operation ||操作类型,排序,固定无需修改| **Curl示例:** curl --location 'http://kefu.easemob.com/api/platform/tenants/29676/customer/search' \ --header 'Kefu-Token: 739170a565e79d97e6fd25d0aa522d4f' \ --header 'Content-Type: application/json' \ --data '{ "page": 0, "size": 9, "conditions": [ { "field_name": "createDateTime", "value": "1677340800000,1677945599000", "operation": "RANGE" } ] }' { "status": "OK", "entity": { "content": [ { "customer_id": "3ece3c0f-0c98-40b2-bf66-b7f6d0a5ed14", "bind_visitors": [ "52dbf2dd-0129-403a-af4f-253f2a0ab27a" ], "created_at": 1677726847333, "updated_at": 1680159446359, "visitor_id": "52dbf2dd-0129-403a-af4f-253f2a0ab27a", "vip": null, "type": null, "level": null, "email": [ "1@1.com" ], "nickname": "12", "phone": [ "15011111111" ], "username": [ "1@1.com" ] } ], "totalElements": 3, "last": false, "totalPages": 3, "sort": null, "first": true, "numberOfElements": 1, "size": 1, "number": 0 } } 参数说明: ^名称^类型^说明^ |customer_id |String |crm客户id| |bind_visitors| List |绑定的访客visitor_id| |visitor_id |string | 访客visitor_id| |vip |boolean| 是否vip,敦煌定制| |type |String| 访客类型,敦煌定制| |level |String |访客级别,敦煌定制| |email| list| 访客邮箱,为空则不返回| |nickname |list| 访客邮箱,为空则不返回| |username |list| 访客ID,为空则不返回| ===== 查询历史会话 ===== ==== 获取历史会话列表 ==== 根据渠道、客户昵称、技能组、坐席、会话接起时间、会话结束时间等条件查询历史会话列表。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/serviceSessionHistorys * HTTP Method: GET * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url 'http://kefu.easemob.com/api/platform/tenants/1/serviceSessionHistorys?stopDateFrom=2021-05-10T00%3A00%3A00.000Z&stopDateTo=2021-05-20T23%3A59%3A00.000Z' \ --header 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |page|int|N|查询页码索引,默认为1| |per_page|int|N|每页显示的数据容量,默认为10,最大为50| |originType| String |N|渠道 不写为查询全部 要查询的话值为 网页:webim,APP:app,微信渠道weixin,微博为weibo,呼叫中心:phone| |customerName| String |N|客户昵称| |transfered|boolean|N|是否转接 是:true 不是:false| |fromAgentCallback|boolean|N|会话类型 回呼:true 呼入:false| |enquirySummary|int|N|评价 值为:0,1,2,3,4,5不填默认查询全部评价| |enquiryDegree|int|N|"3 (一般)" 满意度评价(用于数字评价)| |resolutionScore|int|N| "1" 解决率评价分数 1 已解决 2 未解决(用于数字评价)| |resolutionScore2|int|N| "1" 解决率评价分数 1 已解决 2 未解决(用于数字评价)| |consultResult|int|N| "1" 咨询结果: 有效会话 - 1 ; 无效会话 = 0| |queueIds|int|N|多个技能组ID数组| |beginDate| String |N|会话接起时间(开始范围条件),时间格式 2018-06-16T23%3A59%3A59.000Z| |endDate| String |N|会话接起时间(结束范围条件),时间格式 2018-06-16T23%3A59%3A59.000Z| |stopDateFrom| String |N|会话结束时间(开始范围条件),时间格式 2018-06-16T23%3A59%3A59.000Z| |stopDateTo| String |N|会话结束时间(结束范围条件),时间格式 2018-06-16T23%3A59%3A59.000Z| |createDateFrom| String |N|会话创建时间(开始范围条件),时间格式 2018-06-16T23%3A59%3A59.000Z| |createDateTo| String |N|会话创建时间(结束范围条件),时间格式 2018-06-16T23%3A59%3A59.000Z| |agentIds|list|N|多个坐席的ID数组| |serviceSessionId|String|N|某个会话id,可用于查看某通会话信息,此参数与其他参数不可一同请求| |sortField| String |N|排序字段 stopDateTime startDateTime createDatetime| |sortOrder| String |N|升降序asc desc| **Response示例:** { "status": "OK", "entity": { "total_entries": 3, "items": [ { "serviceSessionId": "45bd1110-69a3-49d0-b9e2-55e9399e3633", "tenantId": 29676, "techChannelId": 1434, "queueId": 161557, "state": "Terminal", "chatGroupId": 4611895, "messageSeqId": 4, "agentUserId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "agentUserNiceName": "Admin昵称1", "agentUserType": 1, "createDatetime": "2021-05-10 18:46:44", "startDateTime": "2021-05-10 18:46:48", "stopDateTime": "2021-05-10 18:56:59", "techChannelType": "wechat", "enquirySummary": "4", "enquiryDegree": "4 (满意)", "resolutionScore": "0", "resolutionScore2": "0", "consultResult": "0", "evaluateWay": "agent", "invited": true, "techChannelName": "环信本地测试", "originType": [ "weixin" ], "comment": "不活跃会话超时结束备注", "visitorUser": { "userId": "479032e4-1d94-4f65-a59b-43515b67d7dc", "nicename": "环信本地测试:o6B_c4p_OKwcGLWqoFCXcXqKExS4", "username": "o6B_c4p_OKwcGLWqoFCXcXqKExS4" }, "customer": { "customerId": "c7e44d7d-8378-44b3-8b30-d4b46d97b62d", "customerNiceName": "环信本地测试:o6B_c4p_OKwcGLWqoFCXcXqKExS4", "customerTrueName": null }, "fromAgentCallback": false, "transfered": false, "agentUserSet": [ { "userId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "username": "15010965776@163.com", "nicename": "Admin昵称1", "trueName": "Admin姓名", "tenantId": "29676" } ], "agentUserList": [ { "userId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "username": "15010965776@163.com", "nicename": "Admin昵称1", "trueName": "Admin姓名", "tenantId": "29676" } ], "agentQueueSet": [ { "queueId": "161557", "queueName": "未分组", "queueType": "QueueNormal", "tenantId": 29676 } ], "agentQueueList": [ { "queueId": "161557", "queueName": "未分组", "queueType": "QueueNormal", "tenantId": 29676 } ], "serviceSessionAttribute": {} }, { "serviceSessionId": "e4bd2cb2-d95d-4db6-85c7-5bf83b559d58", "tenantId": 29676, "techChannelId": 1434, "queueId": 161557, "state": "Terminal", "chatGroupId": 4611895, "messageSeqId": 5, "agentUserId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "agentUserNiceName": "Admin昵称1", "agentUserType": 1, "createDatetime": "2021-05-10 18:19:53", "startDateTime": "2021-05-10 18:20:08", "agentLastMessageDate": "2021-05-10 18:20:12", "stopDateTime": "2021-05-10 18:24:29", "techChannelType": "wechat", "enquirySummary": "5", "enquiryDegree": "5 (非常满意,好)", "resolutionScore": "0", "resolutionScore2": "0", "consultResult": "1", "evaluateWay": "agent", "invited": true, "techChannelName": "环信本地测试", "originType": [ "weixin" ], "visitorUser": { "userId": "479032e4-1d94-4f65-a59b-43515b67d7dc", "nicename": "环信本地测试:o6B_c4p_OKwcGLWqoFCXcXqKExS4", "username": "o6B_c4p_OKwcGLWqoFCXcXqKExS4" }, "customer": { "customerId": "c7e44d7d-8378-44b3-8b30-d4b46d97b62d", "customerNiceName": "环信本地测试:o6B_c4p_OKwcGLWqoFCXcXqKExS4", "customerTrueName": null }, "fromAgentCallback": false, "transfered": false, "enquiryTags": [ { "appraiseTagId": 4784, "name": "未解决" } ], "agentUserSet": [ { "userId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "username": "15010965776@163.com", "nicename": "Admin昵称1", "trueName": "Admin姓名", "tenantId": "29676" } ], "agentUserList": [ { "userId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "username": "15010965776@163.com", "nicename": "Admin昵称1", "trueName": "Admin姓名", "tenantId": "29676" } ], "agentQueueSet": [ { "queueId": "161557", "queueName": "未分组", "queueType": "QueueNormal", "tenantId": 29676 } ], "agentQueueList": [ { "queueId": "161557", "queueName": "未分组", "queueType": "QueueNormal", "tenantId": 29676 } ], "serviceSessionEventHistoryList": [ { "eventId": "82c0ab6d-0291-4376-b838-c7cb177c8e1f", "serviceSessionId": "e4bd2cb2-d95d-4db6-85c7-5bf83b559d58", "tenantId": 29676, "actorId": null, "actorName": null, "fromId": null, "fromName": null, "actorTrueName": null, "fromState": null, "toId": null, "toName": null, "toState": null, "type": "Created", "serviceSessionExt": "{\"fromAgentCallback\":false,\"sessionCreateType\":\"fromRoutingPolicy\",\"routingToRobot\":false,\"queueName\":\"未分组\"}", "createDateTime": "2021-05-10 18:19:53", "timeStamp": null }, { "eventId": "0e2dedcb-8f2b-400e-b1f2-8f489f041bdb", "serviceSessionId": "e4bd2cb2-d95d-4db6-85c7-5bf83b559d58", "tenantId": 29676, "actorId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "actorName": "Admin昵称1", "fromId": null, "fromName": null, "actorTrueName": "Admin姓名", "fromState": null, "toId": null, "toName": null, "toState": null, "type": "Opened", "serviceSessionExt": null, "createDateTime": "2021-05-10 18:20:08", "timeStamp": null }, { "eventId": "e6e3c589-d6b4-498a-9dd0-caf5104fc47a", "serviceSessionId": "e4bd2cb2-d95d-4db6-85c7-5bf83b559d58", "tenantId": 29676, "actorId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "actorName": "Admin昵称1", "fromId": null, "fromName": null, "actorTrueName": "Admin姓名", "fromState": null, "toId": null, "toName": null, "toState": null, "type": "FirstReplyTime", "serviceSessionExt": null, "createDateTime": "2021-05-10 18:20:11", "timeStamp": null }, { "eventId": "836e7ff4-921f-4a79-b494-d5ffeeeb869e", "serviceSessionId": "e4bd2cb2-d95d-4db6-85c7-5bf83b559d58", "tenantId": 29676, "actorId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "actorName": "Admin昵称1", "fromId": null, "fromName": null, "actorTrueName": "Admin姓名", "fromState": null, "toId": null, "toName": null, "toState": null, "type": "Closed", "serviceSessionExt": null, "createDateTime": "2021-05-10 18:24:29", "timeStamp": null } ], "enquiryTagNames": "未解决", "serviceSessionAttribute": {} }, { "serviceSessionId": "55e34279-8a1c-4863-aa66-896fdd80b2ee", "tenantId": 29676, "techChannelId": 23293, "queueId": 161557, "state": "Terminal", "chatGroupId": 4611717, "messageSeqId": 15, "agentUserId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "agentUserNiceName": "Admin昵称1", "agentUserType": 1, "createDatetime": "2021-05-10 11:17:16", "startDateTime": "2021-05-10 11:17:26", "agentLastMessageDate": "2021-05-10 11:20:03", "stopDateTime": "2021-05-10 11:20:09", "techChannelType": "easemob", "enquirySummary": "0", "enquiryDegree": "0", "resolutionScore": "0", "resolutionScore2": "0", "consultResult": "1", "invited": false, "visitorLeaveTime": "2021-05-10 11:20:18", "techChannelName": "体验关联", "originType": [ "webim" ], "visitorUser": { "userId": "49440425-ac26-45df-9bf1-11bf39ca74af", "nicename": "webim-visitor-CKFR3YEGFB2Q672V8W4P", "username": "webim-visitor-CKFR3YEGFB2Q672V8W4P" }, "customer": { "customerId": "5d513e47-0628-4c25-85f3-76627b26ceea", "customerNiceName": "webim-visitor-CKFR3YEGFB2Q672V8W4P", "customerTrueName": null }, "fromAgentCallback": false, "transfered": true, "agentUserSet": [ { "userId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "username": "15010965776@163.com", "nicename": "Admin昵称1", "trueName": "Admin姓名", "tenantId": "29676" }, { "userId": "18c8af0f-5891-4a36-ad49-90fb612d3b8b", "username": "qu1@1.com", "nicename": "qu1@1.com昵称", "trueName": "qu1@1.com姓名", "tenantId": "29676" } ], "agentUserList": [ { "userId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "username": "15010965776@163.com", "nicename": "Admin昵称1", "trueName": "Admin姓名", "tenantId": "29676" }, { "userId": "18c8af0f-5891-4a36-ad49-90fb612d3b8b", "username": "qu1@1.com", "nicename": "qu1@1.com昵称", "trueName": "qu1@1.com姓名", "tenantId": "29676" }, { "userId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "username": "15010965776@163.com", "nicename": "Admin昵称1", "trueName": "Admin姓名", "tenantId": "29676" } ], "agentQueueSet": [ { "queueId": "164924", "queueName": "第一技能组", "queueType": "QueueNormal", "tenantId": 29676 } ], "agentQueueList": [ { "queueId": "164924", "queueName": "第一技能组", "queueType": "QueueNormal", "tenantId": 29676 } ], "serviceSessionEventHistoryList": [ { "eventId": "06fed1c4-fbe2-4ac8-87d6-2d07c340db13", "serviceSessionId": "55e34279-8a1c-4863-aa66-896fdd80b2ee", "tenantId": 29676, "actorId": null, "actorName": null, "fromId": null, "fromName": null, "actorTrueName": null, "fromState": null, "toId": null, "toName": null, "toState": null, "type": "Created", "serviceSessionExt": "{\"fromAgentCallback\":false,\"routingPolicyType\":\"Channel\",\"sessionCreateType\":\"fromRoutingPolicy\",\"routingToRobot\":false,\"queueName\":\"第一技能组\"}", "createDateTime": "2021-05-10 11:17:16", "timeStamp": null }, { "eventId": "d34d7ddf-b1e9-4630-a9bb-5b34eae38e17", "serviceSessionId": "55e34279-8a1c-4863-aa66-896fdd80b2ee", "tenantId": 29676, "actorId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "actorName": "Admin昵称1", "fromId": null, "fromName": null, "actorTrueName": "Admin姓名", "fromState": null, "toId": null, "toName": null, "toState": null, "type": "Opened", "serviceSessionExt": null, "createDateTime": "2021-05-10 11:17:26", "timeStamp": null }, { "eventId": "55c7cabe-9ef9-4572-923f-69c48788866f", "serviceSessionId": "55e34279-8a1c-4863-aa66-896fdd80b2ee", "tenantId": 29676, "actorId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "actorName": "Admin昵称1", "fromId": null, "fromName": null, "actorTrueName": "Admin姓名", "fromState": null, "toId": null, "toName": null, "toState": null, "type": "FirstReplyTime", "serviceSessionExt": null, "createDateTime": "2021-05-10 11:17:27", "timeStamp": null }, { "eventId": "eb7ab5ba-64a9-4aad-a516-16e2d6acbfa1", "serviceSessionId": "55e34279-8a1c-4863-aa66-896fdd80b2ee", "tenantId": 29676, "actorId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "actorName": "Admin昵称1", "fromId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "fromName": "Admin姓名", "actorTrueName": "Admin姓名", "fromState": "Processing", "toId": "18c8af0f-5891-4a36-ad49-90fb612d3b8b", "toName": "qu1@1.com姓名", "toState": "Processing", "type": "TransferAA", "serviceSessionExt": null, "createDateTime": "2021-05-10 11:17:45", "timeStamp": null }, { "eventId": "fb8478a5-2506-4759-b70b-2cfd2fe4a105", "serviceSessionId": "55e34279-8a1c-4863-aa66-896fdd80b2ee", "tenantId": 29676, "actorId": "18c8af0f-5891-4a36-ad49-90fb612d3b8b", "actorName": "qu1@1.com昵称", "fromId": "18c8af0f-5891-4a36-ad49-90fb612d3b8b", "fromName": "qu1@1.com姓名", "actorTrueName": "qu1@1.com姓名", "fromState": "Processing", "toId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "toName": "Admin姓名", "toState": "Processing", "type": "TransferAA", "serviceSessionExt": null, "createDateTime": "2021-05-10 11:19:29", "timeStamp": null }, { "eventId": "6d1f1823-ca5d-48bc-8c04-42abd02fa0ea", "serviceSessionId": "55e34279-8a1c-4863-aa66-896fdd80b2ee", "tenantId": 29676, "actorId": "5dade28d-77e8-43a4-84e8-1eefa0c63748", "actorName": "Admin昵称1", "fromId": null, "fromName": null, "actorTrueName": "Admin姓名", "fromState": null, "toId": null, "toName": null, "toState": null, "type": "Closed", "serviceSessionExt": null, "createDateTime": "2021-05-10 11:20:09", "timeStamp": null } ], "serviceSessionAttribute": { "referer": "https://029676.sandbox.kefu.easemob.com/mo/admin/webapp/channels/web", "searchType": "直接访问", "ip": "211.157.146.18", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36", "region": "中国,北京,北京" } } ] } } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| | total_entries | int | 查询到的历史会话条数 | | serviceSessionId | String | 会话ID | | tenantId | int | 租户ID | | techChannelId | int | 关联ID | | queueId | int | 技能组ID | | state | String | 会话状态 ,会话状态包含的是Wait(排队中)、Processing(进行中)、Terminal(已关闭)| | chatGroupId | int | 访客的群组ID | | messageSeqId | int | 最大消息序列自增标记 | | agentUserId | String | 坐席ID | | agentUserNiceName | String | 坐席昵称 | | agentUserTrueName | String | 真实姓名 | | agentUserType | String | 坐席类型 | | createDatetime | String | 会话创建时间 | | startDateTime | String | 会话接起时间 | | agentLastMessageDate | String | 坐席最后一条消息的时间 | | stopDateTime | String | 会话结束时间 | | techChannelType | String | 关联类型 | | (summarys) id | int | 会话标签ID | | (summarys) name | String | 会话标签名称 | | (summarys) color | int | 会话标签颜色 | | (summarys) parentId | int | 会话标签的父节点ID | | enquirySummary | String | 客户满意度评价 | | enquiryDetail | String | 客户满意度评价详情 | | techChannelName | String | 关联名称 | | originType | String | 渠道类型 网页:webim,APP:app,微信渠道weixin,微博为weibo,呼叫中心:phone | | comment | String | 会话备注 | | (visitorUser) userId | String | 访客ID | | (visitorUser) nicename | String | 访客昵称 | | (visitorUser) username | String | 访客的用户名 | | (customer) customerId | String | 客户ID | | (customer) customerNiceName | String | 客户昵称 | | (customer) customerTrueName | String | 客户的真实姓名 | | messageDetail | String | 消息详情 | | recordFileUrl | String | 话单录音文件名 | | fromAgentCallback | boolean | 会话类型 回呼:true 呼入:false | | transfered | boolean | 是否转接 是:true 不是:false | | visitorUserTags | String | 访客标签 | | enquiryTags | String | 满意度评价标签 | | chatMessages | String | 聊天消息 | | lastChatMessage | String | 最后一条消息 | | (agentUserSet) userId | String | 坐席ID | | (agentUserSet) username | String | 坐席账号(邮箱) | | (agentUserSet) nicename | String | 坐席昵称 | | (agentUserSet) trueName | String | 坐席的真实姓名 | | (agentUserSet) tenantId | String | 坐席的租户ID | | agentQueueSet | String | 会话归属的技能组 | | enquiryTagNames | String | 满意度评价标签的名字 | | summarysDetail | String | 会话小结文本内容 | |||| |serviceSessionEventHistoryList||会话流转事件| | eventId | String | 事件Id | | serviceSessionId | String | 会话Id | | tenantId | String | 租户Id | | actorId | String | 操作人Id | | actorName | String | 操作人昵称 | | fromId | String | 转接自(操作人Id) | | fromName | String | 转接自(操作人昵称)| | actorTrueName | String | 操作人姓名| | fromState | String | 操作前状态 | | toId | String | 转接用户Id | | toName | String | 转接用户姓名 | | toState | String | 操作后状态| | type | String | 事件类型:Created-创建,Opened-接起,FirstReplyTime-首次响应,Transfer转接(AA-坐席转坐席,AQ-坐席转技能组,QA-技能组转坐席,QQ-技能组转技能组,RA-机器人转坐席,RQ-机器人转技能组),Closed-关闭,Aborted-待接入会话关闭| |||| | serviceSessionExt | | 会话相关事件的详细信息 | | fromAgentCallback | boolean | 用于记录会话创建事件,会话是否是回呼 | | assignedAgent | String | 用于记录会话创建事件,记录会话是否指定坐席(指定:坐席的username, 未指定:null) | | routingPolicyType | String | 用于记录会话创建事件,会话路由信息(UserSpecifiedChannel:入口指定,ChannelData:关联指定,Channel:渠道指定, OfficialAccount:服务号指定,SpecialIdentity:特殊身份指定,Default:默认指定) | | sessionCreateType | String | 会话创建的方式( "fromAgentCallback", "fromAassignedAgent", "fromRoutingPolicy") | | routingToRobot | boolean | 是否路由到机器人 | | queueName | String | 路由到技能组的名称 | | createDateTime | String | 事件时间 | | timeStamp | String | 可忽略| |||| | (serviceSessionAttribute) carrierOperator | String | 运营商 | | (serviceSessionAttribute)referer | String | 来源信息 | | (serviceSessionAttribute)system | String | 操作系统 | | (serviceSessionAttribute)userAgent | String | 软件环境 | | (serviceSessionAttribute)version | String | 系统版本 | | (serviceSessionAttribute)searchType | String | 推广来源 | | (serviceSessionAttribute)accessUrl | String | 着陆页 | | (serviceSessionAttribute)ip | String | IP | | (serviceSessionAttribute)equipment | String | 设备 | | (serviceSessionAttribute)region | String | 地区 | | (serviceSessionAttribute)equipment | keyword | 搜索词 | ==== 获取历史会话详情 ==== 根据会话ID查询历史会话详情。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/servicesessions/{sessionServiceId}/messages * HTTP Method: GET * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url 'http://kefu.easemob.com/api/platform/tenants/8019/servicesessions/05303239-dd9e-4afe-bf69-92469da17612/messages?page=0&size=10&_=1561514960554' \ --header 'Kefu-Token: a7f3d2bcb62721a3c67b8f567acfd553' \ 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |sessionServiceId|String|Y|会话ID| |page|int|N|查询页码索引,默认为0| |size|int|N|每页显示的数据容量,默认为10,最大为50| **Response示例:** { "status": "OK", "entities": [ { "msgId": "332d6236-df15-46e9-b4e8-7b797351264b", "tenantId": 55899, "chatGroupId": 118488700, "sessionServiceId": "f109dbe1-bf97-4562-9627-8acb30957181", "messageType": "ChatMessage", "fromUser": { "tenantId": 0, "userId": "_2", "userType": "Scheduler", "userScope": "Tenant", "nicename": "调度员", "scope": "Tenant", "bizId": "0", "status": "Disable", "roles": "" }, "contentType": "application/easemob-msg", "body": { "bodies": [ { "action": "ServiceSessionClosedEvent", "type": "cmd" } ], "ext": { "weichat": { "msgId": "332d6236-df15-46e9-b4e8-7b797351264b", "originType": "webim", "agent": {}, "queueId": 95953, "queueName": "售前", "event": { "eventName": "ServiceSessionClosedEvent" }, "service_session": { "serviceSessionId": "f109dbe1-bf97-4562-9627-8acb30957181", "robotId": 0, "state": "Terminal", "messageSeqId": 4, "agentUserId": "56a353b5-453b-4ecb-a3c3-4bf0f00e24b9", "agentUserType": 1, "expire": false }, "official_account": { "official_account_id": "da4f72df-e405-486d-b153-cf7b203b6769", "name": "个人-7", "type": "SYSTEM", "img": "//kefu.easemob.com/v1/tenants/55899/mediafiles/c08adf10-b217-4b81-95ca-1f8345e4d6186ZSu55uYLmpwZw==/cutout?arg=699_291_1865_1865_300_300", "schedule_info": {} } } }, "from": "调度员", "to": "webim-visitor-KTTG7XMBG9P482C93HCP", "channelType": "easemob", "timestamp": 1556174648179, "tenantId": 55899, "visitorUserId": "94a6efed-38d1-45cd-a784-41e94df55186", "originType": "webim", "channel_id": 81029 }, "chatGroupSeqId": 55, "sessionServiceSeqId": 0, "createDateTime": 1556174648179, "timestamp": 1559133258854, "createMicroTimestamp": 1556174648179000 }, { "msgId": "9b9bcb78-e257-46bd-bddc-df271af229db", "tenantId": 55899, "chatGroupId": 118488700, "sessionServiceId": "f109dbe1-bf97-4562-9627-8acb30957181", "messageType": "ChatMessage", "fromUser": { "tenantId": 0, "userId": "_2", "userType": "Scheduler", "userScope": "Tenant", "nicename": "调度员", "scope": "Tenant", "bizId": "0", "status": "Disable", "roles": "" }, "contentType": "application/easemob-msg", "body": { "bodies": [ { "action": "ServiceSessionOpenedEvent", "type": "cmd" } ], "ext": { "weichat": { "msgId": "9b9bcb78-e257-46bd-bddc-df271af229db", "originType": "webim", "agent": {}, "queueId": 95953, "queueName": "售前", "event": { "eventName": "ServiceSessionOpenedEvent", "eventObj": { "userId": "56a353b5-453b-4ecb-a3c3-4bf0f00e24b9", "agentUserNiceName": "xu8", "agentType": 1, "sessionId": "f109dbe1-bf97-4562-9627-8acb30957181" } }, "service_session": { "serviceSessionId": "f109dbe1-bf97-4562-9627-8acb30957181", "robotId": 0, "state": "Processing", "messageSeqId": 3, "agentUserId": "56a353b5-453b-4ecb-a3c3-4bf0f00e24b9", "agentUserType": 1, "expire": false }, "official_account": { "official_account_id": "da4f72df-e405-486d-b153-cf7b203b6769", "name": "个人-7", "type": "SYSTEM", "img": "//kefu.easemob.com/v1/tenants/55899/mediafiles/c08adf10-b217-4b81-95ca-1f8345e4d6186ZSu55uYLmpwZw==/cutout?arg=699_291_1865_1865_300_300", "schedule_info": {} } } }, "from": "调度员", "to": "webim-visitor-KTTG7XMBG9P482C93HCP", "channelType": "easemob", "timestamp": 1556174639110, "tenantId": 55899, "visitorUserId": "94a6efed-38d1-45cd-a784-41e94df55186", "originType": "webim", "channel_id": 81029 }, "chatGroupSeqId": 54, "sessionServiceSeqId": 0, "createDateTime": 1556174639110, "timestamp": 1559133258854, "createMicroTimestamp": 1556174639110000 }, { "msgId": "aa4ab60b-5534-4327-bc58-8b8064b925cb", "tenantId": 55899, "chatGroupId": 118488700, "sessionServiceId": "f109dbe1-bf97-4562-9627-8acb30957181", "messageType": "ChatMessage", "fromUser": { "tenantId": 0, "userId": "_2", "userType": "Scheduler", "userScope": "Tenant", "nicename": "调度员", "scope": "Tenant", "bizId": "0", "status": "Disable", "roles": "" }, "contentType": "application/easemob-msg", "body": { "bodies": [ { "action": "ServiceSessionCreatedEvent", "type": "cmd" } ], "ext": { "weichat": { "msgId": "aa4ab60b-5534-4327-bc58-8b8064b925cb", "originType": "webim", "agent": {}, "queueId": 95953, "queueName": "售前", "event": { "eventName": "ServiceSessionCreatedEvent", "eventObj": { "sessionId": "f109dbe1-bf97-4562-9627-8acb30957181" } }, "service_session": { "serviceSessionId": "f109dbe1-bf97-4562-9627-8acb30957181", "robotId": 0, "state": "Processing", "messageSeqId": 2, "agentUserId": "56a353b5-453b-4ecb-a3c3-4bf0f00e24b9", "agentUserType": 1, "expire": false }, "official_account": { "official_account_id": "da4f72df-e405-486d-b153-cf7b203b6769", "name": "个人-7", "type": "SYSTEM", "img": "//kefu.easemob.com/v1/tenants/55899/mediafiles/c08adf10-b217-4b81-95ca-1f8345e4d6186ZSu55uYLmpwZw==/cutout?arg=699_291_1865_1865_300_300", "schedule_info": {} } } }, "from": "调度员", "to": "webim-visitor-KTTG7XMBG9P482C93HCP", "channelType": "easemob", "timestamp": 1556174638984, "tenantId": 55899, "visitorUserId": "94a6efed-38d1-45cd-a784-41e94df55186", "originType": "webim", "channel_id": 81029 }, "chatGroupSeqId": 53, "sessionServiceSeqId": 0, "createDateTime": 1556174638984, "timestamp": 1559133258854, "createMicroTimestamp": 1556174638984000 }, { "msgId": "44b5e9fe-40eb-42ed-b93b-6545404ddb74", "tenantId": 55899, "chatGroupId": 118488700, "sessionServiceId": "f109dbe1-bf97-4562-9627-8acb30957181", "messageType": "ChatMessage", "fromUser": { "tenantId": 0, "userId": "_2", "userType": "Scheduler", "userScope": "Tenant", "nicename": "调度员", "scope": "Tenant", "bizId": "0", "status": "Disable", "roles": "" }, "contentType": "application/easemob-msg", "body": { "bodies": [ { "msg": "您好,有什么可以帮助您的吗?", "type": "txt" } ], "ext": { "weichat": { "msgId": "44b5e9fe-40eb-42ed-b93b-6545404ddb74", "originType": "webim", "visitor": null, "agent": { "avatar": null, "userNickname": null }, "queueId": 95953, "queueName": "售前", "agentUsername": null, "ctrlType": null, "ctrlArgs": null, "event": null, "metadata": null, "callcenter": null, "language": "zh-CN", "marketing": null, "service_session": { "serviceSessionId": "f109dbe1-bf97-4562-9627-8acb30957181", "robotId": 0, "state": "Processing", "messageSeqId": 1, "agentUserId": "56a353b5-453b-4ecb-a3c3-4bf0f00e24b9", "agentUserType": 1, "expire": false }, "html_safe_body": { "type": "txt", "msg": "您好,有什么可以帮助您的吗?" }, "msg_id_for_ack": "94086d60-e8dc-45db-94ae-f96087bb1f1d", "ack_for_msg_id": null, "recall_flag": null, "recall_msg_id": null, "official_account": { "official_account_id": "da4f72df-e405-486d-b153-cf7b203b6769", "name": "个人-7", "type": "SYSTEM", "img": "//kefu.easemob.com/v1/tenants/55899/mediafiles/c08adf10-b217-4b81-95ca-1f8345e4d6186ZSu55uYLmpwZw==/cutout?arg=699_291_1865_1865_300_300", "schedule_info": {} }, "reserve_queue": null, "match_flag": null } }, "from": "调度员", "to": "webim-visitor-KTTG7XMBG9P482C93HCP", "channelType": "easemob", "timestamp": 1556174638854, "tenantId": 55899, "visitorUserId": "94a6efed-38d1-45cd-a784-41e94df55186", "originType": "webim", "channel_id": 81029 }, "chatGroupSeqId": 52, "sessionServiceSeqId": 0, "createDateTime": 1556174638854, "timestamp": 1559133258854, "createMicroTimestamp": 1556174638854000 }, { "msgId": "45159d25-68ce-4b91-84f1-8e9fb918d0fb", "tenantId": 55899, "chatGroupId": 118488700, "sessionServiceId": "f109dbe1-bf97-4562-9627-8acb30957181", "messageType": "ChatMessage", "fromUser": { "tenantId": 0, "userId": "94a6efed-38d1-45cd-a784-41e94df55186", "userType": "Visitor", "userScope": "Tenant", "nicename": "webim-visitor-KTTG7XMBG9P482C93HCP", "scope": "Tenant", "bizId": "0", "status": "Disable", "roles": "" }, "contentType": "application/easemob-msg", "body": { "bodies": [ { "msg": "cdasc", "type": "txt" } ], "ext": { "weichat": { "msgId": "45159d25-68ce-4b91-84f1-8e9fb918d0fb", "originType": "webim", "visitor": null, "agent": null, "queueId": null, "queueName": null, "agentUsername": null, "ctrlType": null, "ctrlArgs": null, "event": null, "metadata": null, "callcenter": null, "language": "zh-CN", "marketing": null, "service_session": null, "html_safe_body": { "type": "txt", "msg": "cdasc" }, "msg_id_for_ack": "94086d60-e8dc-45db-94ae-f96087bb1f1d", "ack_for_msg_id": null, "recall_flag": null, "recall_msg_id": null, "official_account": { "official_account_id": "da4f72df-e405-486d-b153-cf7b203b6769", "name": "个人-7", "type": "SYSTEM", "img": "//kefu.easemob.com/v1/tenants/55899/mediafiles/c08adf10-b217-4b81-95ca-1f8345e4d6186ZSu55uYLmpwZw==/cutout?arg=699_291_1865_1865_300_300", "schedule_info": {} }, "reserve_queue": null, "match_flag": null } }, "from": "webim-visitor-KTTG7XMBG9P482C93HCP", "to": "169704", "channelType": "easemob", "timestamp": 1556174638385, "tenantId": 55899, "serviceSessionId": "f109dbe1-bf97-4562-9627-8acb30957181", "visitorUserId": "94a6efed-38d1-45cd-a784-41e94df55186", "originType": "webim", "to_jid": "experience-kefu#sandbox_169704@easemob.com", "msg_id": "595324722682528396", "channel_id": 81029, "channel_name": "体验关联" }, "chatGroupSeqId": 51, "sessionServiceSeqId": 0, "createDateTime": 1556174638745, "timestamp": 1559133258854, "createMicroTimestamp": 1556174638745000 } ], "first": true, "last": true, "size": 10, "number": 0, "numberOfElements": 5, "totalPages": 1, "totalElements": 5 } 参数说明: ^名称^类型^说明^ |status|String|接口响应状态| |msgId|String|消息Id| |tenantId|Integer|租户Id| |sessionServiceId|String|会话Id| |messageType|String|消息类型| |(fromUser)tenantId|Integer|租户Id| |(fromUser)userId|String|Id| |(fromUser)userType|String|类型| |(fromUser)userScope|String|用户层级| |(fromUser)nicename|String|昵称| |(fromUser)scope|String|用户层级| |(fromUser)bizId|String|租户Id| |(fromUser)status|String|用户状态| |contentType|String|消息内容类型| |(bodies)|String|事件名称| |(bodies)|String|消息类型| |(ext.weichat)msgId|String|消息Id| |(ext.weichat)originType|String|渠道类型| |(ext.weichat)queueId|Long|技能组Id| |(ext.weichat)queueName|String|技能组名称| |(ext.weichat.event.eventName)|String|事件名| |(ext.weichat.service_session)serviceSessionId|String|会话Id| |(ext.weichat.service_session)robotId|Integer|机器人Id| |(ext.weichat.service_session)state|String|会话状态| |(ext.weichat.service_session)messageSeqId|Long|最大消息序列自增标记 ,注:messageSeqId 不代表完整消息数,其特殊情况下,messageSeqId 可能会有重复情况| |(ext.weichat.service_session)agentUserId|String|坐席Id| |(ext.weichat.service_session)agentUserType|Integer|坐席类型| |(ext.weichat.service_session)expire|Boolean|会话是否过期| |(ext.weichat.service_session)categoryId|Integer|标识该会话是否只有无效的访客消息| |(ext.weichat.hide_flag)|Boolean|消息是否上屏| |(body)from|String|发送者昵称| |(body)to|String|接受者昵称| |(body)channelType|String|关联类型| |(body)timestamp|Date|时间戳| |(body)tenantId |Integer|租户Id| |(body)visitorUserId|String|访客Id| |(body)originType|String|渠道类型| |(body)channel_id|Integer|关联Id| |first|Boolean|是否为第一页| |last|Boolean|是否为最后一页| |size|Integer|页大小| |number|Integer|页码| |numberOfElements|Integer|当前页element数量| |totalPages|Integer|总页数| |totalElements|Integer|总个数| ===== 呼叫中心 ===== ==== 获取历史通话列表 ==== 根据呼叫类型、通话时间、技能组、坐席、挂断原因、满意度评价等条件查询历史通话列表。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/calldetails * HTTP Method: GET * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url 'http://kefu.easemob.com/api/platform/tenants/28994/calldetails?page=0&size=14&startTime=2019-11-10%2023:00:00&stopTime=2019-11-16%2023:00:00&contactType=Inbound&orderType=DESC&order=&contactDisposition=ALL&phoneNumber=&useStop=false&satisfaction=' \ --header 'Kefu-Token:a7f3d2bcb62721a3c67b8f567acfd553' \ 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |page|int|N|查询页码索引,默认为0,0代表查询第一页数据| |size|int|N|每页显示的数据容量,默认为10,最大为50| |startTime| String |N|通话时间(开始范围条件),时间格式 2018-06-16T23%3A59%3A59.000Z| |stopTime| String |N|通话时间(结束范围条件),时间格式 2018-06-16T23%3A59%3A59.000Z| |contactType| String |N|通话类型,取值:Inbound(呼入),Outbound(呼出),Back2Back(双呼),Internal(内部通话),多个条件以英文逗号隔开| |orderType| String |N|排序方式,取值:ASC/DESC,默认DESC| |contactDisposition| String |N|挂断原因,取值:ALL(全部),Success(正常),NoAnswer(未接通),AbandonedInContactFlow(IVR中放弃),AbandonedInQueue(排队放弃),AbandonedRing(振铃放弃),QueueOverflow(排队超时),OneStepTransfer(转外线)| |phoneNumber| String |N|手机号码,同时检索主叫和被叫号码| |satisfaction| String |N|满意度评价,取值:0(未发送),998(未评价),满意,一般,不满意| **Response示例:** { "status": "OK", "entities": [ { "id": "10301193-7c1a-4b9a-9285-164040c189b8", "ccId": "d00842df-e406-4f32-9929-80b02f26e07c", "contactId": "2561536188", "staffId": "83162635-be49-486e-9334-d358276feda0", "groupId": "e155be22-05ca-4535-89aa-ad3c8d358d45", "labelId": null, "visitorId": "fd07207a-d2d5-4dab-8637-800a27c526f9", "contactType": "Inbound", "contactDisposition": "Success", "callingNumber": "18612390240", "calledNumber": "02160556504", "recordFileName": "157372327914600080309018.wav", "province": "北京", "city": "北京", "duration": 22, "validDuration":14, "satisfaction": 0, "satisfactionDesc": "未发送", "startTime": 1573723266000, "stopTime": 1573723288000, "syncStartTime": 1573723266000, "syncStopTime": 1573723288000, "syncFlag": true, "recordSyncFlag": 1, "agentNames": "aliyun_cc_02", "skillGroupNames": "沙箱技能组", "visitor": { "tenantId": 28994, "userId": "fd07207a-d2d5-4dab-8637-800a27c526f9", "createDateTime": 1543994461000, "lastUpdateDateTime": 1563959840000, "nickname": "18612390240", "trueName": "大帅哥", "sex": 0, "qq": "260553619", "weixin": "嘻嘻,喜闻乐见", "email": "leoli@easemob.com", "phone": "18612390240", "companyName": "环信", "description": "环信环信环信环信环信环信" }, "evaluateContent": null, "recordingDataList": [ { "fileName": "157372327914600080309018.wav", "startTime": 1573723279000 } ] } ], "first": true, "last": true, "number": 0, "numberOfElements": 4, "totalPages": 1, "totalElements": 4 } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| |id| String |通话记录ID| |ccid| String |呼叫中心实例ID| |contactId| String |通话ID| |staffId| String |客服ID| |groupId| int |技能组ID| |labelId| int |通话标签ID| |visitorId| String |访客环信ID| |contactType| String |通话类型| |contactDisposition| String |挂断原因| |callingNumber| String |主叫号码| |calledNumber| String |被叫号码| |recordFileName| String |通话录音文件名称| |province| String |访客号码归属地-省| |city| String |访客号码归属地-市| |duration| Int |总通话时长| |validDuration| Int |有效通话时长| |satisfaction| String |满意度值| |satisfactionDesc| String |满意度评价信息| |startTime| String |通话开始时间| |stopTime| String |通话结束时间| |syncFlag| Boolean |通话详单生成标识,true为已生成| |recordSyncFlag| Integer |录音生成标识,1为已生成,8为无录音| |agentNames| String |客服昵称,若存在转接,则为多个| |skillGroupNames| String |技能组名称| |tenantId| int |租户ID| | | |visitor访客信息| |userId| String |访客ID| |createDateTime| String |创建时间| |lastUpdateDateTime| String |更新时间| |nickname| String |昵称| |trueName| String |姓名| |sex| String |性别| |qq| String |QQ| |weixin| String |微信| |email| String |邮箱| |phone| String |电话| |companyName| String |公司名称| |description| String |备注| | | |evaluateContent| String |服务小结| |fileName| String |录音文件名| |startTime| String |录音开始时间| |first| boolean |是否是第一页| |last| boolean |是否是最后一页| |number| int |当前页码| |numberOfElements| int |当前页数据量| |totalPages| int |总页数| |totalElements| int |总数据量| ==== 获取通话录音 ==== 根据通话id查询通话录音。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/recording/{contactId} * HTTP Method: GET * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url 'http://kefu.easemob.com/api/platform/tenants/20080/recording/3059753965' \ --header 'Kefu-Token:a7f3d2bcb62721a3c67b8f567acfd553' \ 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |contactId|int|Y|通话id| **Response示例:** { "entity": [ { "tenantId": 20080, "ccId": "d00842df-e406-4f32-9929-80b02f26e07c", "staffUsername": "gcy@easemob.com", "staffNickname": "gcy@easemob.com", "staffTruename": "gcy", "fileName": "161519050124500080550386.wav", "fileUrl": "http%3A%2F%2Fcloudcallcenter-online.oss-cn-shanghai.aliyuncs.com%2Frecord%2Ff626832e-3da0-4c99-b534-ed3a2116b626%2F161519050124500080550386.wav%3FExpires%3D1615285356%26OSSAccessKeyId%3DLTAIvKWEr4DoFSqz%26Signature%3D7%252BTZaLQAng6iisw4R1LFVIUj1Gg%253D", "startTime": 1615190501000, "contactType": "Inbound", "callingNumber": "18829209656", "calledNumber": "02160556504", "contactId": "3059753965", "duration": 21 }, { "tenantId": 20080, "ccId": "d00842df-e406-4f32-9929-80b02f26e07c", "staffUsername": "gcy_test@qq.com", "staffNickname": "gcy_test", "staffTruename": "gcy_test", "fileName": "161519051281300080580663.wav", "fileUrl": "http%3A%2F%2Fcloudcallcenter-online.oss-cn-shanghai.aliyuncs.com%2Frecord%2Ff626832e-3da0-4c99-b534-ed3a2116b626%2F161519051281300080580663.wav%3FExpires%3D1615285356%26OSSAccessKeyId%3DLTAIvKWEr4DoFSqz%26Signature%3DX%252FhBkDVR3HCIMSvHTkUcfA%252BFFcQ%253D", "startTime": 1615190512000, "contactType": "Inbound", "callingNumber": "18829209656", "calledNumber": "02160556504", "contactId": "3059753965", "duration": 30 } ] } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| |tenantId| String |租户ID| |ccid| String |呼叫中心实例ID| |contactId| String |通话ID| |contactType| String |通话类型:呼入/呼出/双呼等| |callingNumber| String |主叫号码| |calledNumber| String |被叫号码| |staffUsername| String |客服账号| |staffNickname| String |客服昵称| |staffTruename| String |客服姓名| |fileName| String |录音文件名| |fileUrl| String |录音文件路径| |startTime| String |开始时间| |duration| String |录音时长| ===== 工单 ===== ==== 查询自定义表单 ==== 可查询在环信客服云后台设置的自定义表单列表。 应用场景: 您自己的业务系统/APP里提交工单,您自己开发提交工单的页面,调用环信工单接口,工单数据提交至环信客服云。您自己开发提交工单的页面时,需要指定用户填写的工单字段,这一步调用此接口完成。获取自定义表单后,您可在页面上直接指定用户填写哪一个表单的字段,也可让用户自行选择表单(让用户选择业务分类)。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/integration-ticket/forms * HTTP Method: GET * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url 'http://kefu.easemob.com/api/platform/tenants/20016/integration-ticket/forms' \ --header 'Kefu-Token:a7f3d2bcb62721a3c67b8f567acfd553' \ 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId| int |Y|租户ID| |page| int |N|页码,默认为0| |size| int |N|每页的数据量,默认为10| **Response示例:** { "status": "OK", "entities": [ { "id": "7f0f0af4-71bd-4c04-b049-c98802cb793b", "tenant_id": 200161, "created": "2019-11-28T03:11:18Z", "updated": "2019-11-28T03:11:18Z", "name": "自定义表单111", "description": "测试自定义表单功能", "status": "enabled", "fields": [ { "id": "6cf63d66-5f0a-4a53-acb4-e46998227342", "tenant_id": 200161, "created": "2019-11-28T03:14:49Z", "updated": "2019-11-28T03:14:49Z", "name": "自定义表单222", "description": "测试自定义表单2222", "status": "enabled", "fields": [ { "id": "e7d32c88-22e0-4ffd-95df-741e628ada8e", "tenant_id": 200161, "created": "2019-11-28T03:24:25Z", "updated": "2019-11-28T03:24:25Z", "form_id": "6cf63d66-5f0a-4a53-acb4-e46998227342", "name": "男,女", "label": "性别", "type": "TEXT_STRING", "visible": true, "required": "ON", "sort": 1, "hint": "填写性别", "dictionary_items": [], "cascade_items": [] }, { "id": "2c17ad7b-c808-4850-94e7-d39ecf743d7e", "tenant_id": 200161, "created": "2019-11-28T03:24:53Z", "updated": "2019-11-28T03:24:53Z", "form_id": "6cf63d66-5f0a-4a53-acb4-e46998227342", "name": "填写爱好", "label": "爱好", "type": "SELECT_STRING", "dictionary_id": "eb9fb55e-3978-40ac-bc79-8623af7bc11b", "visible": true, "required": "ON", "sort": 2, "dictionary_items": [], "cascade_items": [] }, { "id": "ceb2ca78-6118-42de-9e21-23baf366dba1", "tenant_id": 200161, "created": "2019-11-28T03:25:26Z", "updated": "2019-11-28T03:25:26Z", "form_id": "6cf63d66-5f0a-4a53-acb4-e46998227342", "name": "填写出生日期", "label": "出生日期", "type": "NUMBER", "visible": true, "required": "ON", "sort": 3, "hint": "填写出生日期", "dictionary_items": [], "cascade_items": [] } ], "topics": [ { "id": "351d899f-c83c-476c-8f71-bc1918eb4ba0", "tenant_id": 200161, "created": "2019-11-27T10:31:05Z", "updated": "2019-11-27T10:31:05Z", "parent_id": "eb72bc55-cbd6-454b-be81-1ad1b8df4940", "name": "第二级别主题", "is_active": 1, "is_public": 1, "full_name": "/hegj帮助主题1/第二级别主题", "children": [ { "id": "2e272127-84d2-49a2-964e-e507d4a374f3", "tenant_id": 200161, "created": "2019-11-27T10:31:17Z", "updated": "2019-11-27T10:31:17Z", "parent_id": "351d899f-c83c-476c-8f71-bc1918eb4ba0", "name": "第三级别主题1", "is_active": 1, "is_public": 1, "children": [ { "id": "1ba44df9-ee60-4b8a-83ce-ff007a46bc38", "tenant_id": 200161, "created": "2019-11-27T10:31:30Z", "updated": "2019-11-27T10:31:30Z", "parent_id": "2e272127-84d2-49a2-964e-e507d4a374f3", "name": "第四级主题1", "is_active": 1, "is_public": 1, "full_name": "/hegj帮助主题1/第二级别主题/第三级别主题1/第四级主题1", "children": [ { "id": "aca22ed9-f392-4620-8676-2d44da4a3891", "tenant_id": 200161, "created": "2019-11-27T10:31:40Z", "updated": "2019-11-27T10:31:40Z", "parent_id": "1ba44df9-ee60-4b8a-83ce-ff007a46bc38", "name": "第五级主题1", "is_active": 1, "is_public": 1, "children": [ { "id": "1bb2a127-9179-4d4f-9352-20c341180c85", "tenant_id": 200161, "created": "2019-11-27T10:31:49Z", "updated": "2019-11-27T10:31:49Z", "parent_id": "aca22ed9-f392-4620-8676-2d44da4a3891", "name": "第六级主题1", "is_active": 1, "is_public": 1 } ] } ] } ] } ] }, { "id": "1bb2a127-9179-4d4f-9352-20c341180c85", "tenant_id": 200161, "created": "2019-11-27T10:31:49Z", "updated": "2019-11-27T10:31:49Z", "parent_id": "aca22ed9-f392-4620-8676-2d44da4a3891", "name": "第六级主题1", "is_active": 1, "is_public": 1, "full_name": "/hegj帮助主题1/第二级别主题/第三级别主题1/第四级主题1/第五级主题1/第六级主题1" }, { "id": "1ba44df9-ee60-4b8a-83ce-ff007a46bc38", "tenant_id": 200161, "created": "2019-11-27T10:31:30Z", "updated": "2019-11-27T10:31:30Z", "parent_id": "2e272127-84d2-49a2-964e-e507d4a374f3", "name": "第四级主题1", "is_active": 1, "is_public": 1, "full_name": "/hegj帮助主题1/第二级别主题/第三级别主题1/第四级主题1", "children": [ { "id": "aca22ed9-f392-4620-8676-2d44da4a3891", "tenant_id": 200161, "created": "2019-11-27T10:31:40Z", "updated": "2019-11-27T10:31:40Z", "parent_id": "1ba44df9-ee60-4b8a-83ce-ff007a46bc38", "name": "第五级主题1", "is_active": 1, "is_public": 1, "children": [ { "id": "1bb2a127-9179-4d4f-9352-20c341180c85", "tenant_id": 200161, "created": "2019-11-27T10:31:49Z", "updated": "2019-11-27T10:31:49Z", "parent_id": "aca22ed9-f392-4620-8676-2d44da4a3891", "name": "第六级主题1", "is_active": 1, "is_public": 1 } ] } ] } ], "topic_ids": [ "1ba44df9-ee60-4b8a-83ce-ff007a46bc38", "351d899f-c83c-476c-8f71-bc1918eb4ba0", "1bb2a127-9179-4d4f-9352-20c341180c85" ] }, { "id": "kefu_27886", "tenant_id": 200161, "created": "2019-11-27T07:22:35Z", "updated": "2019-11-27T07:22:35Z", "name": "默认表单", "description": "租户默认的自定义表单", "status": "enabled", "fields": [], "topics": [], "topic_ids": [] } ], "first": true, "last": true, "size": 10, "number": 0, "numberOfElements": 3, "totalPages": 1, "totalElements": 3 } 参数说明: ^名称^类型^说明^ |httpStatusCode| String |http状态码| |status| String |接口响应状态| |entities| |表单列表| |first| Boolean |是否是第一页| |last| Boolean |是否是最后一页| |size| int |每页的数据量| |number| String |第几页| |numberOfElements| int |该页的数据量| |totalPages| int |总页数| |totalElements| int|总数据量| |||| |表单数据| |id| String |表单ID,自定义表单的唯一标识| |tenant_id| String |租户ID| |created| int |表单创建时间| |updated| String |表单修改时间| |name| String |表单名称| |description| String |描述| |status| String|状态,enabled| |fields| |List,自定义字段信息| |topics| |List,表单关联的帮助主题| |topic_ids| String |表单关联的帮助主题Id列表| |||| |表单字段数据| |id| String |字段ID,字段的唯一标识| |tenant_id| String |租户ID| |created| int |字段创建时间| |updated| String |字段修改时间| |form_id| String |表单ID| |name| String |字段标识| |label| String |字段名称| |type| String|字段格式:TEXT_STRING 单行文本,DATE 日期,NUMBER 数字类型,URL URL,SELECT_STRING 下拉选项,TEXTAREA_STRING 多行文本,CASCADE_SELECT_STRING 级联选择| |dictionary_id| String |关联下拉选项| |visible| Boolean |访客是否可见| |required| Boolean |是否必填| |sort| String |排序字段| |hint| String |文本框提示语| |dictionary_items| |List,下拉选项| |cascade_items| |List,级联选项| |||| |选项数据| |id| String |每个选项的ID| |tenant_id| String |租户ID| |created| int |选项创建时间| |updated| String |选项修改时间| |dictionary_Id| String |关联字段ID| |item_value| String |选项名称| |sort| String |排序字段| |status| String |可忽略| |||| |级联选项| |id| String |每个级联的ID| |tenant_id| String |租户ID| |created| int |选项创建时间| |updated| String |选项修改时间| |field_id| String |字段ID| |form_id| String |表单ID| |name| String |级联选项名称| |parent_id| String |父节点ID| |children| |List,子节点| ==== 工单附件上传 ==== 提交工单/回复工单时,若需要上传附件,则需要先调用此接口上传附件,再调用访客提交工单接口提交工单。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/integration-ticket/mediaFiles * HTTP Method: POST * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url 'http://kefu.easemob.com/api/platform/tenants/20016/integration-ticket/mediaFiles' \ --header 'Kefu-Token:a7f3d2bcb62721a3c67b8f567acfd553' \ --form 'file=@/Users/heguojiao/Downloads/第024期-lcn.pptx' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |file|form-data|Y|附件信息| **Response示例:** { "status": "OK", "entity": { "uuid": "010b99ec-ba54-4062-b6cf-a20737ae782e56ysMDI05pyfLWxjbi5wcHR4", "contentType": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "contentLength": 1385894, "url": "/v2/tenants/20016/integration/ticket-server/visitors/mediaFiles/010b99ec-ba54-4062-b6cf-a20737ae782e56ysMDI05pyfLWxjbi5wcHR4", "fileName": "第024期-lcn.pptx" } } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| |entity| |附件信息| |||| |附件信息| |uuid| String |附件ID| |contentType| String |附件类型| |contentLength| String |附件大小| |url| String |附件地址| |fileName| String |附件名称| ==== 工单状态接口 ==== **获取token:** 1.开放平台需要使用token进行身份验证。 2.Kefu-Token有效期2小时,到期需重新获取。 登录地址: ^操作^|更新修改工单状态,标题,优先级,工单内容,分配组,分配人的接口| ^协议^| HTTPS | ^方式^| PUT | ^URL^|/api/platform/tenants/{tenantId}/integration-ticket/{ticketId}/updateTicketInfo| 请求参数: ^参数^是否必传^描述^参数类型^数据类型^ |tenantId| 是 |租户Id|Path|integer| |ticketId|是|工单Id|Path|String| |requestBody|是|请求体|Body|object| requestBody包括以下几个参数: ^参数^是否必传^描述^数据类型^ |title|否|标题|String| |status_id|否|工单状态id|String| |staff_id|是|坐席id|String| |team_id|否|技能组Id|String| |priority_id|否|优先级id|String| |content|否|工单内容|String| 返回数据: ^HTTP状态Code^含义^ |200|OK| |API_007|Staff_id不能为空| ^成功返回数据^含义^ |Status|OK| |entities|List| **请求示例:** 请求数据格式都应该是application/json,编码形式为UTF-8 { "title":"开放平台45", "status_id":"7732d036-fdcc-4996-973e-0d9323a39617", "team_id":"dfdgsd", "staff_id":"hksjdks77555", "priority_id":"tjuncu1", "content":"公章" } } **成功返回示例:** { "status": "OK", "entity": { "id": "eca76b2c-a69a-48d8-8056-7fad0ff290f3", "tenant_id": 11, "title":"开放平台45", "status_id":"7732d036-fdcc-4996-973e-0d9323a39617", "team_id":"dfdgsd", "staff_id":"hksjdks77555", "priority_id":"tjuncu1", "content":"公章", "satisfaction_score": 0, "quality_score": 0, "operator_id": "hksjdks77555", "operator_type": "S", "is_admin": true, "form_values": [], "is_read": 0 } } ==== 访客提交工单 ==== 访客提交工单接口。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/integration-ticket/visitors/ticket * HTTP Method: POST * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url 'http://kefu.easemob.com/api/platform/tenants/20016/integration-ticket/visitors/ticket' \ --header 'Kefu-Token:a7f3d2bcb62721a3c67b8f567acfd553' \ --header 'Content-Type: application/json' \ --data-raw '{ "title": "标题222334", "content": "描述222334", "visitor_phone": "13662124786", "visitor_email": "8122334@qq.com", "visitor_nickname": "称呼222334", "attachments": [ { "name": "message-center-server服务未升级组件.png", "file_type": "image/png", "size": 970870, "url": "http://sandbox.kefu.easemob.com//v2/tenants/27886/integration/ticket-server/visitors/mediaFiles/c5154e5e-09c4-476c-a2f6-f6a1ca42eaa1bWVzc2FnZS1jZW50ZXItc2VydmVy5pyN5Yqh5pyq5Y2H57qn57uE5Lu2LnBuZw==", "uuid": "c5154e5e-09c4-476c-a2f6-f6a1ca42eaa1bWVzc2FnZS1jZW50ZXItc2VydmVy5pyN5Yqh5pyq5Y2H57qn57uE5Lu2LnBuZw==" } ], "form_values": [ { "field_id": "2c17ad7b-c808-4850-94e7-d39ecf743d7e", "field_value": "篮球" }, { "field_id": "e7d32c88-22e0-4ffd-95df-741e628ada8e", "field_value": "女" }, { "field_id": "ceb2ca78-6118-42de-9e21-23baf366dba1", "field_value": "22" }, { "field_id": "030eb800-00f4-4ff0-96b1-01edb15d0016", "field_value": "级联选项1/级联选项1-1", "item_ids": "6b550cfd-74b6-405c-aadf-c82989f4b52e_09d44dab-196a-4529-9c8b-1c92f7152037" } ], "form_id": "6cf63d66-5f0a-4a53-acb4-e46998227342" }' 参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |title|String|Y|标题| |content|String|Y|内容| |visitor_phone|String|Y|访客手机号| |visitor_email|String|Y|访客邮箱| |visitor_nickname|String|Y|访客昵称| |attachments|String|N|附件信息| |form_id|String|N|表单ID| |form_values|String|N|表单自定义字段信息| |||| |附件信息| |name|String||附件名,对应上传附件接口里的fileName字段| |file_type|String||对应上传附件接口里的contentType字段| |size|String||对应上传附件接口里的contentLength字段| |url|String||对应上传附件接口里的url字段| |uuid|String||对应上传附件接口里的uuid字段| |||| |自定义表单字段| |field_id|String||字段ID| |file_type|String||填写内容| |item_ids|String||对于级联字段设置的层级id| **Response示例:** { "status": "OK", "entity": { "id": "75eb5d2e-3235-431d-b716-5b634736cf5b", "tenant_id": 200161, "created": "2020-09-16T07:42:46Z", "updated": "2020-09-16T07:42:46Z", "title": "标题222334", "code": "A0000004", "visitor_user_id": "64022b77-166d-4a68-bc37-fdb146a07dfa", "status_id": "ff22d6d8-3da5-4ec2-8920-aa645b332c5a", "source": "API", "creator_id": "64022b77-166d-4a68-bc37-fdb146a07dfa", "creator_type": "C", "content": "描述222334", "form_id": "6cf63d66-5f0a-4a53-acb4-e46998227342", "satisfaction_score": 0, "quality_score": 0, "operator_id": "64022b77-166d-4a68-bc37-fdb146a07dfa", "operator_type": "C", "form_values": [ { "id": "196fc01c-650d-4b3d-9755-e2221541155e", "tenant_id": 200161, "created": "2020-09-16T07:42:46Z", "updated": "2020-09-16T07:42:46Z", "field_id": "2c17ad7b-c808-4850-94e7-d39ecf743d7e", "field_value": "篮球" }, { "id": "d774aed5-6dc8-469d-ba30-287ebe99faaa", "tenant_id": 200161, "created": "2020-09-16T07:42:46Z", "updated": "2020-09-16T07:42:46Z", "field_id": "030eb800-00f4-4ff0-96b1-01edb15d0016", "field_value": "级联选项1/级联选项1-1", "item_ids": "6b550cfd-74b6-405c-aadf-c82989f4b52e_09d44dab-196a-4529-9c8b-1c92f7152037" }, { "id": "611bfc78-b3a0-468a-80c7-89cf4c6b8d41", "tenant_id": 200161, "created": "2020-09-16T07:42:46Z", "updated": "2020-09-16T07:42:46Z", "field_id": "ceb2ca78-6118-42de-9e21-23baf366dba1", "field_value": "22" }, { "id": "6c51017a-de6e-426b-a4b8-038befc6a936", "tenant_id": 200161, "created": "2020-09-16T07:42:46Z", "updated": "2020-09-16T07:42:46Z", "field_id": "e7d32c88-22e0-4ffd-95df-741e628ada8e", "field_value": "女" } ], "is_read": 0 } } 参数说明: ^名称^类型^说明^ |status| String |接口响应状态| |entity| |工单信息| |||| |工单信息| |id| String |工单id| |tenant_id| String |租户id| |created| String |创建时间| |updated| String |修改时间| |title| String |工单标题| |code| String |工单编号| |visitor_user_id| String |访客ID| |status_id| String |工单状态ID| |source| String |固定传值“API”| |creator_id| String |创建者ID| |creator_type| String |创建者类型(S、C)STAFF("S"), CUSTOMER("C")| |content| String |工单内容| |form_id| String |表单ID| |satisfaction_score| String |满意度评分| |quality_score| String |质检评分| |operator_id| String |质检员ID| |operator_type| String |质检员类型| |form_values| String |List,表单自定义字段内容| |is_read| String |工单已读未读功能| |||| |FormValue| |id| String |工单和字段关联ID| |tenant_id| String |租户id| |created| String |创建时间| |updated| String |修改时间| |field_id| String |字段ID| |field_value| String |字段对应的填写的内容| ==== 访客回复工单 ==== 访客回复工单接口。 * Path: http://kefu.easemob.com/api/platform/tenants/{tenantId}/integration-ticket/visitors/{ticketId}/comments * HTTP Method: POST * Request Headers: Kefu-Token=${accessToken} * 可能的错误码:详见:[[#错误码说明|错误码说明]] **Curl示例:** curl --request GET \ --url 'http://kefu.easemob.com/api/platform/tenants/20016/integration-ticket/visitors/{ticketId}/comments' \ --header 'Kefu-Token:a7f3d2bcb62721a3c67b8f567acfd553' \ -d '{ "body": "

aaaappppiiii

", "format": "html", "attachments": [ { "contentType": "image/png", "contentLength": 239008, "url": "https://sandbox.kefu.easemob.com/v2/tenants/29676/integration/ticket-server/visitors/mediaFiles/afec47f4-659d-4dd9-9406-1e07bc7ca9415raI5oGvLnBuZw==", "name": "消息.png" } ], "visitor_email": "qu@api.com" }'
参数说明: ^名称^类型^是否非空(Y:是;N:否)^说明^ |Kefu-Token| String |Y|调用接口的accessToken| |tenantId|int|Y|租户ID| |ticketId|String|Y|工单ID| |body|String|Y|回复内容| |format|String|Y|文本格式| |visitor_email|String|Y|访客邮箱| |attachments||N|附件| |附件信息| |contentType|String||类型| |contentLength|String||附件大小| |url|String||附件地址| |name|String||附件名称| **Response示例:** { "status": "OK", "entity": { "id": "01237efe-6d43-4092-afb3-49efbf22b9ef", "tenant_id": 601, "created": "2021-01-11T14:49:28Z", "updated": "2021-01-11T14:49:28Z", "ticket_id": "e863ba5e-6e54-429c-9674-7e5a43cf495c", "visitor_user_id": "8fdfca59-9e4b-466c-84a7-06f3cd0ce942", "body": "

aaaappppiiii

", "format": "html", "is_public": true, "attachments": [ { "id": "c54109e1-98fe-4f62-a00f-8e4394f9b669", "tenant_id": 601, "url": "https://sandbox.kefu.easemob.com/v2/tenants/29676/integration/ticket-server/visitors/mediaFiles/afec47f4-659d-4dd9-9406-1e07bc7ca9415raI5oGvLnBuZw==", "right_attachment": false } ], "public_response_type": "EMAIL" } }
参数说明: ^名称^类型^说明^ |status| String |接口响应状态| |entity| |回复信息| |id|String|评论ID| |tenantId|String|租户ID| |created|String|评论添加时间| |updated|String|评论修改事件| |ticket_id|String|工单id| |visitor_user_id|String|访客ID| |body|String|回复内容| |format|String|文本格式| |is_public|String|是否公开回复| |attachments||附件| |附件信息| |id|String|类型| |tenant_id|String|附件大小| |url|String|附件地址| |right_attachment|String|| |public_response_type|String|回复渠道| ===== 错误码说明 ===== ^错误码^错误信息^注释^ |API_001|param is invalid,please check your param is correct!|参数传递错误| |API_002|token is invalid|token不正确| |API_003|tenantId is incorrect,please confirm that the tenant ID belongs to you|租户ID错误| |API_004|clientId or secretId is incorrect|clientId或者secretId不正确| |API_020|Request body contains more than 10 visitor usernames.|请求访客绑定关系的数量不能多于10个| |API_101|create agent user is failed|创建坐席失败| |API_102|agent nicename must not empty!|坐席昵称不能为空| |API_103|agent user already exist|坐席已经存在| |API_104|agent user not exist,please check username is correct|坐席不存在| |API_105|agent user not belong your tenant,please check username and tenantId is correct|坐席和租户不匹配| |API_106|roleId must not empty|角色ID不能为空| |API_107|api add role is failed,please check roleId is valid|添加角色失败| |API_108|password must be not empty and length greater 7.|密码不能为空且大于7位| |API_109|Can not remove only amdin|不能删除唯一的管理员| |API_110|Can not remove agent,The agent has processing servicesession.|由于该坐席有会话未关闭,该坐席不能删除| |API_111|page index must be more than 0.|分页索引必须大于0| |API_112|page size must be less than 50.|分页每页的容量不能大于50| |API_113|state must be Online or Busy or Leave or Other or Offline or Hidden or Logout.|请求状态不正确| |API_400|api request failed|服务间调用请求错误| |API_117|tenant without ticket function|租户没有开通工单功能| |API_118|tenant without yuncentercall function|租户没有开通云呼功能| ===== 不同格式消息结构 ===== 新消息对应的报文格式 1.文本:txt 报文: { "eventId": "91a007c0-1215-11ec-90a5-a10326678cd1", "timestamp": 1631264438855, "event": "ServiceSessionMessageEvent", "payload": { "message": { "id": "a06529e8-4b31-4042-a738-af2d1296b6cb", "service_session_id": "54eeacc4-6946-4b80-bd8e-f0a4426211f8", "msg_id_for_ack": "997f6f43-e11f-4898-a21f-4f643a6dfb18", "create_at": 1631264438793, "from": { "id": "2735acf5-a003-42f9-8ada-fdcc6581ee09", "name": "webim-visitor-8MQTGP9E4VEEGHEWBFXQ", "type": "Visitor" }, "to": { "id": "f6a9ae57-6bd8-4ba5-9478-10027d6143a2", "name": "宋晓伟", "type": "Agent" }, "origin_type": "webim", "channel": { "id": 23457, "name": "关联2", "type": "easemob" }, "body": { "msg": "会尽快", "type": "txt" }, "ext": { } } } } 2.cmd { "eventId": "51dfa130-121b-11ec-8511-fb6f37820f89", "timestamp": 1631266908881, "event": "ServiceSessionMessageEvent", "payload": { "message": { "id": "f7bc1803-1d3c-4346-b46d-a6a1f58e39af", "service_session_id": "6baa6363-6770-4110-b319-4a2a6b14e02e", "msg_id_for_ack": NULL, "create_at": 1631266908814"from": { "id": "_2", "name": "关联设置调度员", "type": "Scheduler" }, "to": { "id": "2735acf5-a003-42f9-8ada-fdcc6581ee09", "name": "webim-visitor-8MQTGP9E4VEEGHEWBFXQ", "type": "Visitor" }, "origin_type": "webim", "channel": { "id": 23457, "type": "easemob" }, "body": { "action": "ServiceSessionOpenedEvent", "type": "cmd" }, "ext": { } } } } 3.图片:img { "eventId": "73c94200-1217-11ec-90ce-e186d8435957", "timestamp": 1631265247817, "event": "ServiceSessionMessageEvent", "payload": { "message": { "id": "aff765d2-f7b5-443a-939c-718446cf70a2", "service_session_id": "3dea8e64-1f94-4ecd-aaab-daae8161b4a5", "msg_id_for_ack": "fbc6ded2-62ba-4731-8d0b-65f8d3b074b0", "create_at": 1631265247718, "from": { "id": "2735acf5-a003-42f9-8ada-fdcc6581ee09", "name": "webim-visitor-8MQTGP9E4VEEGHEWBFXQ", "type": "Visitor" }, "to": { "id": "", "name": "", "type": "Agent" }, "origin_type": "webim", "channel": { "id": 23457, "name": "关联2", "type": "easemob" }, "body": { "url": "/v1/Tenant/29676/MediaFiles/bf086bfe-2bb0-4b28-874e-dab6d09753c55YiG5biD5byP6ZSB6Zeu6aKYLnBuZw==", "filename": "分布式锁问题.png", "type": "img" }, "ext": {} } } } 4.文件 file { "eventId": "15980750-1219-11ec-abcd-4112b9a39f21", "timestamp": 1631265948754, "event": "ServiceSessionMessageEvent", "payload": { "message": { "id": "c710292d-87c0-4d1a-ab11-4eb0af7c62f3", "service_session_id": "7f76bdbd-cc65-4e04-a8b8-14c8b7139525", "msg_id_for_ack": "", "create_at": 1631265948677, "from": { "id": "c6e5df54-ce63-4c8c-8a1d-c1fac4feecc3", "name": "webim-visitor-9BM6XB77QTE2R7Y7R6VH", "type": "Visitor" }, "to": { "id": "8215d830-d998-4f54-9d66-eefabcaa36da", "name": "客服机器人-小鹤", "type": "Robot" }, "origin_type": "webim", "channel": { "id": 23700, "name": "快速创建的关联", "type": "easemob" }, "body": { "url": "/v1/Tenant/29762/MediaFiles/dd9372b3-958f-4295-9d90-b78bd6e25d6256uW5bGP6KeG6aKRLm1wNA==", "secret": "FUNXqhIZEeyHRyM6cNo2pkf8p1g18YHIIVtPfkHst5LV8hUv", "filename": "竖屏视频.mp4", "type": "file", "file_length": 0 }, "ext": {} } } } 5.视频 video { "eventId": "05f38310-1219-11ec-9d15-f9ee668587e3", "timestamp": 1631265922519, "event": "ServiceSessionMessageEvent", "payload": { "message": { "id": "11050e01-0ff9-4953-a3c6-3d513ad1bda7", "service_session_id": "7f76bdbd-cc65-4e04-a8b8-14c8b7139525", "msg_id_for_ack": "", "create_at": 1631265922427, "from": { "id": "c6e5df54-ce63-4c8c-8a1d-c1fac4feecc3", "name": "webim-visitor-9BM6XB77QTE2R7Y7R6VH", "type": "Visitor" }, "to": { "id": "8215d830-d998-4f54-9d66-eefabcaa36da", "name": "客服机器人-小鹤", "type": "Robot" }, "origin_type": "webim", "channel": { "id": 23700, "name": "快速创建的关联", "type": "easemob" }, "body": { "url": "/v1/Tenant/29762/MediaFiles/d97c5f88-8ac3-49d0-91ad-49cd7a66801daGFzYXNkLm1wNA==", "secret": "BZt4ChIZEeyaUT88YVfVmi4oeK9hT0_UXefA6R87K8NgHxDG", "filename": "hasasd.mp4", "size": { "width": 0, "height": 0 }, "length": 0, "type": "video", "file_length": 0 }, "ext": {} } } 位置:loc { "eventId": "80bb8fd0-121d-11ec-87e8-d927c5568258", "timestamp": 1631267846567, "event ": "ServiceSessionMessageEvent ", "payload": { "message": { "id": "42e2e99c-ab2d-430e-b91a-db5607328ed3", "service_session_id": "776d6be3-cf1a-47d3-aad9-79f5d3288107", "msg_id_for_ack": "a739f0f352c046748826f16c12ef20af", "create_at": 1631267846444, "from": { "id": "f604a463-e27b-43d1-9273-16927ea1987d", "name": "3bfbbc20cae9432c9753fc36a96b937334792", "type": "Visitor" }, "to": { "id": "43d92e7f-f6a0-420e-8868-693ccc8afa6d", "name": "fs", "type": "Robot" }, "origin_type": "app", "channel": { "id": 97244, "name": "快速创建的关联111", "type": "easemob" }, "body": { "addr": "IDP教育(海淀分公司)", "lat": "39.96616243929114", "lng": "116.32302823756933", "type": "loc" }, "ext": {} } } } 语音:audio { "eventId": "78448230-121d-11ec-969a-83b2be719b1c", "timestamp": 1631267832367, "event": "ServiceSessionMessageEvent", "payload": { "message": { "id": "b7a3ce9f-0672-4b84-948a-5224504e3e0c", "service_session_id": "776d6be3-cf1a-47d3-aad9-79f5d3288107", "msg_id_for_ack": "e0da0acff549417cb5b6d3e9801e577f", "create_at": 1631267832242, "from": { "id": "f604a463-e27b-43d1-9273-16927ea1987d", "name": "3bfbbc20cae9432c9753fc36a96b937334792", "type": "Visitor" }, "to": { "id": "43d92e7f-f6a0-420e-8868-693ccc8afa6d", "name": "fs", "type": "Robot" }, "origin_type": "app", "channel": { "id": 97244, "name": "快速创建的关联111", "type": "easemob" }, "body": { "url": "/v1/Tenant/2112/MediaFiles/eb3c9468-e3b5-4421-b1de-39aa493f9104YXVkaW8=", "secret": "eAMMahIdEeyeb8sE833GrNu3csSD9_RsgID97l0uvwrCCQtd", "filename": "audio", "length": 1, "type": "audio" }, "ext": {} } } }