5G消息上行消息通知
1、概述
终端手机发送的上行消息,转发给客户。流程见平台回调流程。
2、审核结果通知
在开户的时候填写回调地址
3、平台回调参数
| 名称 | 数据类型 | 是否必有 | 描述 | |
|---|---|---|---|---|
| result | string | 是 | 回调状态码(0代表成功响应) | |
| desc | string | 是 | 描述 | |
| rcsReplyForwards | array[object] | 是 | 回复对象 | |
| chatbot | string | 是 | chatbot的编号 | |
| msgid | string | 是 | 消息编号(终端生成),与contributionId一样都是对于一条消息的标识,区别在于messageId用于状态报告回调 字符串长度限制范围:10-36 |
|
| dateTime | date | 是 | 时间 时间格式:yyyy-MM-dd HH:mm:ss |
|
| phone | string | 是 | 上行手机号码 | |
| conversationId | string | 是 | 唯一标识【主被叫】用户间的一次会话,建议用UUID,触发上行消息携带的conversationId将填写该下行消息的conversationId值 | |
| contributionId | string | 是 | 唯一标识一条消息,建议采用UUID,对上行消息回复时携带该字段作为inReplyTo的值 | |
| inReplyTo | string | 否 | 标识此条消息是对【某条上行消息】的回复,值为对方某条上行消息的contributionId,既可以是终端对客户的回复,也可以是客户对终端的回复。比如上行事件、场景发送等。 字符串长度限制范围:10-39 |
|
| replyType | int | 是 | 上行消息类型 |
|
| replyContent | objetct | 是 | 上行内容 当:replyType = |
|
4、平台回调示例
4.1、文本消息/地理位置消息
| 名称 | 数据类型 | 是否必有 | 描述 |
|---|---|---|---|
| replyType | int | 是 | 类型:文本消息/地理位置消息,值为1 |
| replyContent | string | 是 | 文本或者地理位置信息 |
{
"result": "0",
"desc": "成功",
"rcsReplyForwards": [
{
"chatbot": "a92e43085a0049ba8928b61fa04eeee",
"contributionId": "aa56f0c0-1c87-3b78-854b-ad3d7a6b5546",
"conversationId": "35aaabe7-7c63-3c89-be92-8618d7c21f5d",
"dateTime": "2023-02-14 09:37:22",
"msgid": "7718a455-fd6e-3611-b059-73966d2c6acd",
"replyContent": "这是文本",
"replyType": 1,
"phone": "15766666666"
}
]
}
4.2、文件消息
| 名称 | 数据类型 | 是否必有 | 描述 | |
|---|---|---|---|---|
| replyType | int | 是 | 类型:文件消息,值为2 | |
| replyContent | array[object] | 是 | 文件对象的集合 | |
| fileName | string | 是 | 文件名称 | |
| fileSize | int | 是 | 文件大小(单位:byte) | |
| fileType | int | 是 | 素材类型 |
|
| flagVariable | int | 是 | 动态变量标识 |
|
| type | string | 是 | 文件类型 |
|
| until | date | 是 | 文件有效期 时间格式:yyyy-MM-dd HH:mm:ss |
|
| url | string | 是 | 文件路径 | |
{
"result": "0",
"desc": "成功",
"rcsReplyForwards": [
{
"chatbot": "a92e43085a0049ba8928b61fa04eeee",
"contributionId": "278f55b6-8d9a-103b-8616-7546b239ba9b",
"conversationId": "b6d9be4336c7412e9ae5bcdb071f065f",
"dateTime": "2023-02-13 15:01:25",
"msgid": "278f2979-8d9a-103b-8538-bbbf06e8fc68",
"replyContent": [
{
"fileName": "Screenshot_20230209_101626-415.jpg",
"fileSize": 40924,
"fileType": 0,
"flagVariable": 0,
"type": "file",
"until": "2023-02-20 15:01:25",
"url": "rcs/a6889c1ff54b46aa90520e7e3cd7fb3c.jpg"
}
],
"replyType": 2,
"phone": "15766666666"
}
]
}
4.3、触发菜单中的点击事件
建议菜单/悬浮菜单的replyConent格式见:点击事件
| 名称 | 数据类型 | 是否必有 | 描述 |
|---|---|---|---|
| replyType | int | 是 | 类型:触发菜单中的点击事件,值为3 |
| replyContent | object | 是 | 点击事件 |
{
"result": "0",
"desc": "成功",
"rcsReplyForwards": [
{
"chatbot": "a92e43085a0049ba8928b61fa04eeee",
"contributionId": "aca4aa76-8d9b-103b-a7dd-9b466b46e70a",
"conversationId": "7fe6d6f645fe4df1bb11befa60f4015d",
"dateTime": "2023-02-13 15:12:18",
"inReplyTo": "8c05aab6bb124028ac4a64f016a8799c",
"msgid": "aca4619a-8d9b-103b-819a-fda2fed0136a",
"replyContent": {
"action": {
"displayText": "地理位置/展示位置",
"postback": {
"data": "回执操作"
}
}
},
"replyType": 3,
"phone": "15766666666"
}
]
}
4.4、终端分享的数据
触发点击操作,终端将终端信息返给平台,当前数据分享如:分享设备信息(点击事件中的1.2.7)
| 名称 | 数据类型 | 是否必有 | 描述 | |
|---|---|---|---|---|
| replyType | int | 是 | 类型:终端分享的数据,值为4 | |
| replyContent | object | 是 | 当前数据分享如:分享设备信息(点击事件中的1.2.7) | |
| batteryRemainingMinutes | string | 是 | 终端的剩余电量可用分钟数 | |
| clientVendor | string | 是 | 设备制造商 | |
| platformVersion | string | 是 | 系统版本 | |
| deviceModel | string | 是 | 设备型号 | |
| clientVersion | string | 是 | 客户端版本 | |
{
"result": "0",
"desc": "成功",
"rcsReplyForwards": [
{
"chatbot": "a92e43085a0049ba8928b61fa04eeee",
"contributionId": "835256b4-8d9c-103b-849e-474fca6306ec",
"conversationId": "d54efb4aad884f8fbb3da554f13a4f83",
"dateTime": "2023-02-13 15:18:18",
"inReplyTo": "69e8091b4b6448188eea02a6ea84608b",
"msgid": "83524593-8d9c-103b-91a2-131d1239046f",
"replyContent": {
"batteryRemainingMinutes": "2242",
"clientVendor": "JUPH",
"platformVersion": "11",
"deviceModel": "ZTE 8030N",
"clientVersion": "GB-2.53.1.1"
},
"replyType": 4,
"phone": "15766666666"
}
]
}
5、客户响应参数
| 名称 | 数据类型 | 是否必有 | 描述 |
|---|---|---|---|
| status | string | 是 | success 成功,其他的都视为推送不成功 |
6、客户响应示例
HTTP/1.1 200 OK
Server: IAG
Date: Thu, 11 Jun 2020 10:12:21 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 123
Connection: close
{
"status": "success"
}文档更新时间: 2025-12-17 09:34 作者:王超