POST /ccmessaging/send
描述
发送渠道消息,包括连接,发送输入状态,会话,转人工,断连多种类型消息
接口方法
POST
接口URI
https://域名/apiaccess/ccmessaging/send,例如域名是https://service.besclouds.com
请求说明
序号 |
名称 |
参数类型 |
是否必选 |
说明 |
---|---|---|---|---|
1 |
ccmessaging-token |
string |
True |
|
2 |
x-app-key |
string |
True |
appKey字段,用户标识,请联系运营人员获取appKey |
3 |
Authorization |
string |
True |
鉴权字段,内容格式为:Bearer +tokenByAKSK接口的返回值中AccessToken(Bearer后有空格) |
序号 |
名称 |
参数类型 |
是否必选 |
说明 |
---|---|---|---|---|
1 |
reqBody |
True |
请求体 |
响应说明
- 响应状态码: 200
- 响应状态码: 400
错误的请求:请检查请求路径及参数。
- 响应状态码: 401
未授权:1. 请确认是否购买了相关服务。 2. 请联系客服人员检查您账号的当前状态。
- 响应状态码: 404
请求的内容未找到:请检查请求的路径。
- 响应状态码: 500
业务失败:请依次确认您请求中各参数的取值。
错误码
无。
报文样例
- 场景描述:连接机器人
请求参数:
{ "content": "", "controlType": "CONNECT", "from": "session_1619573111751_user_1619573111751", "mediaType": "TEXT", "senderNickname": "user_1619573111751", "sourceType": "CUSTOMER", "timestamp": "1619573122352", "to": "1011577355744904195", "userAgent": null, "senderAvatar": null, "channel": "WEB" }
响应参数:
{ "resultCode": "0", "resultDesc": "connect to robot success." }
- 场景描述:与机器人交谈请求
请求参数:
{ "content": "版本", "controlType": "CHAT", "from": "session_1619573111751_user_1619573111751", "mediaType": "TEXT", "senderNickname": "user_1619573111751", "sourceType": "CUSTOMER", "timestamp": "1619573123199", "to": "1011577355744904195", "userAgent": null, "senderAvatar": null, "channel": "WEB" }
响应参数:
{ "resultCode": "0", "resultDesc": "Send message to robot successfully" }
- 场景描述:机器人转人工请求
请求参数:
{ "content": "", "controlType": "TRANS2AGENT", "from": "session_1619573111751_user_1619573111751", "mediaType": "TEXT", "senderNickname": "user_1619573111751", "sourceType": "CUSTOMER", "timestamp": "1619573129953", "to": "1011577355744904195", "userAgent": null, "senderAvatar": null, "channel": "WEB" }
响应参数:
{ "resultCode": "0", "resultDesc": "transfer from robot to agent success." }
- 场景描述:断连请求
请求参数:
{ "content": "", "controlType": "DISCONNECT", "from": "session_1619573842490_user_1619573842490", "mediaType": "TEXT", "senderNickname": "user_1619573842490", "sourceType": "CUSTOMER", "timestamp": "1619573854156", "to": "1011577355744904195", "userAgent": null, "senderAvatar": null, "channel": "WEB" }
响应参数:
{ "resultCode": "0", "resultDesc": "Disconnect robot successfully" }