5G消息降级接口
消息用途
在提供单独的5G消息增强版、5G消息标准版发送接口能力的基础上,额外提供支持尝试降级的接口。要求flow/群发界面/业务流程在调用降级接口时,同时传递增强版5G和标准版5G消息。
回落短信和回落视频短信都会默认添加ChabotH5链接地址。
方法
HTTPs:POST
URL:https://{serverRoot}/v2/{chatbotAddress}/outbound-downgrade
Basepath: openchatbot
消息关键参数
请求体关键字段
5G消息降级接口关键字段
|
序号 |
字段 |
数据类型 |
可选属性 |
描述 |
|---|---|---|---|---|
|
1 |
senderAddress |
xsd:anyURI |
M |
发送方地址,填写Chatbot的URI。 |
|
2 |
fiveGenMsgBody |
5GMESSAGEBODY |
O |
5G消息发送Body。 详细请参见表1。 |
|
3 |
videoMessageBody |
VIDEOMESSAGEBODY |
C |
视频短信消息发送Body。 详细请参见表2。 |
|
4 |
smsMessageBody |
SmsMessageBody |
C |
回落短信模板信息。 详细请参见表3。 |
|
5 |
messageSwitch |
String |
M |
1:同时支持5G消息以及视频短信 2:只发送5G消息 4:同时支持5G消息以及普通短信 |
|
6 |
destinationAddress |
AddressInfo数组 |
M |
接收方地址。 详细请参见表4。 |
|
7 |
allowForwarH5URL |
String |
O |
由北向chatbot在降级接口中带入指定。
|
|
8 |
taskId |
string |
O |
任务 id,由北向传入。 |
|
9 |
taskName |
string |
O |
任务名称,由北向传入。 |
|
序号 |
字段 |
数据类型 |
可选属性 |
描述 |
|---|---|---|---|---|
|
1 |
SenderName |
String |
O |
发送方名称 |
|
2 |
productType |
String |
O |
5G产品类型:不传默认为1 1:通知 2:营销 |
|
3 |
outboundIMMessage |
OutboundIMMessage |
O |
详细参见表1的定义。 |
|
序号 |
字段 |
数据类型 |
可选属性 |
描述 |
|---|---|---|---|---|
|
1 |
enterpriseId |
String |
M |
企业ID信息,由接入客户在业务开通时系统统一生成,通过邮件发送给接入客户。如果接入客户有代理多个企业,则华为视频短信平台需要根据传入的企业ID信息进行业务交互和处理 |
|
2 |
taskName |
String |
M |
视频短信名称 |
|
3 |
templateId |
String |
M |
关联模板id,必须要是审核通过可以正常发送的模板 |
|
4 |
taskSendMode |
Integer |
M |
发送模式 1:立即发送 |
|
序号 |
字段 |
数据类型 |
可选属性 |
描述 |
|---|---|---|---|---|
|
1 |
templateId |
String |
O |
短信模板id |
|
2 |
templateParas |
map<string, string> |
O |
5G消息发送Body |
|
3 |
signature |
String |
O |
签名名称,必须是已审核通过的 |
|
4 |
smsBodyText |
string |
O |
转短消息时的短信内容。 |
|
序号 |
字段 |
数据类型 |
可选属性 |
描述 |
|---|---|---|---|---|
|
1 |
sendMobile |
String |
M |
发送的单个号码 |
|
2 |
parasValue |
Map<String,Object> |
O |
填写需要给每个号码分配的动态参数值,采用Map<String,Object>结构,具体格式参考如下: {“p1”: object1, “p2”: object2} 其中Object为json对象其属性格式如下: {"type":"txt","source":"txt","content":"sss"}
说明:
|
响应消息关键参数
|
序号 |
字段 |
数据类型 |
可选属性 |
描述 |
|---|---|---|---|---|
|
1 |
resultCode |
String |
M |
接口返回码,0则表示成功,其他则表示失败 |
|
2 |
resultDesc |
String |
O |
返回描述 |
|
3 |
messageId |
String |
M |
消息id |
|
4 |
sendMobileList |
SENDMOBILE数组 |
O |
描述每个号码的发送状态 详细请参见表5。 |
消息示例
(1)请求
POST /openchatbot/v2/{chatbotAddress}/outbound-downgrade HTTP/1.1
Authorization:Username="a20a9716-8577-4e5e-8333-490df5b72e9f", Password="******"
Content-Type: application/json
Accept: */*
Host: 10.186.76.175:8323
accept-encoding: gzip, deflate
content-length: 1881
Connection: keep-alive
{
"senderAddress": "chatbotid_test003",
"fiveGenMsgBody": {
"clientCorrelator": "567895",
"productType": "1",
"senderName": "Default Name",
"outboundIMMessage": {
"bodyText": "<![CDATA[--next\r\nContent-Type: text/plain\r\nContent-Length: 8\r\n\r\n文本消息hell0\r\n--next\r\nContent-Type: application/vnd.gsma.botsuggestion.v1.0+json\r\nContent-Length: 239\r\n\r\n{\"suggestions\":[{\"action\":{\"displayText\":\"拨打电话\",\"postback\":{\"data\":\"nasc__muti32_1614647261509\"},\"dialerAction\":{\"dialPhoneNumber\":{\"phoneNumber\":\"10086\"}}}},{\"reply\":{\"displayText\":\"回复\",\"postback\":{\"data\":\"nasc__muti32_1614647262875\"}}}]}\r\n--next--]]>",
"contentType": "multipart/mixed; boundary=\"next\"",
"contributionID": "2a4b2c0c-fa07-42f6-9761-1c9671a8e3ba",
"conversationID": "ecd64c32-3733-42e4-88db-c184a847ece8",
"reportRequest": ["Delivered",
"Failed",
"Sent",
"Displayed"],
"serviceCapability": {
"capabilityId": "ChatbotSA",
"version": "v1.0"
},
"shortMessageSupported": "false",
"storeSupported": "true",
"subject": "Default Subject"
}
},
"videoMessageBody": {
"enterpriseId": "279d84d3ec564d27a493d3e29c11a77e",
"taskName": "cph003",
"templateId": "VMS_21080400002",
"taskSendMode": 1
},
"destinationAddress": [
{
"sendMobile": "tel:+8613588304220",
"parasValue":{"p1":{"type":"txt","source":"txt","content":"sss"}}
}
],
"messageSwitch": "1",
"allowForwarH5URL": "0"
}
(2)响应
HTTP/1.1 200
Content-Type: application/json
Content-Encoding: gzip
Connection: close
{
"resultCode": "0",
"resultDesc": "SUCCESS",
"messageId": "e3a2f223-8f3f-4083-8cb0-216a1cf04da4",
"sendMobileList": [
{
"sendMobile": "tel:+8613588304220",
"sendRoute": "2"
}
]
}