注册送短信

API: rcs/template - 模板查询API


概览


rcs/template 用于查询5G消息模板。



URL


https://api-v4.mysubmail.com/rcs/template


接口响应数据格式


格式URL
jsonhttps://api-v4.mysubmail.com/rcs/template.json(默认)
xmlhttps://api-v4.mysubmail.com/rcs/template.xml
yamlhttps://api-v4.mysubmail.com/rcs/template.yaml


一、创建模板


请求方式content-type设置
get




请求参数


参数类型必须/可选默认描述
appidstring必须在 SUBMAIL Chatbot中创建的5G消息应用ID
timestampint可选UNIX 时间戳,结果以秒为单位,使用加密鉴权方式,此参数必填
signTypeenum可选normalAPI 鉴权模式,可选参数normalsha256
signaturestring必须鉴权签名
1. 当signTypesha256时,将以下参数拼接
appid+appkey+appid=12345&signType=sha256& timestamp=1712122221+appid+appkey
“+”号为链接符号,不参与拼接
用sha256将以上拼接字符串加密作为鉴权参数
signTypenormal时,appkey即是signature的值
templateIDstring可选模板ID
offsetint可选0偏移量
rowsint可选50数据行

请求示例


curl --location --request GET 'https://api-v4.mysubmail.com/rcs/template?appid=appid&signature=appkey&templateID=Xs4dvE'


成功返回
{
    "status": "success",
    "templates": [
        {
            "account": "508284d4749fcbf0750ee9c1b28302af",
            "templateID": "uyiQbe",
            "title": "单卡片消息",
            "contentType": "application/vnd.gsma.botmessage.v1.0+json",
            "message": "{\"message\":{\"generalPurposeCard\":{\"layout\":{\"cardWidth\":\"MEDIUM_WIDTH\",\"cardOrientation\":\"VERTICAL\",\"imageAlignment\":\"LEFT\"},\"content\":{\"media\":{\"mediaUrl\":\"https://ftnj01.xnq.r.10086.cn:10099/s/003032024040311atT7rLLdSyn050FD.png\",\"mediaContentType\":\"image/png\",\"mediaFileSize\":\"1259515\",\"height\":\"MEDIUM_HEIGHT\"},\"title\":\"这是卡片标题\",\"description\":\"这是卡片正文\",\"suggestions\":[{\"action\":{\"displayText\":\"打开链接(内置浏览器)\",\"postback\":{\"data\":\"open_url_internal\"},\"urlAction\":{\"openUrl\":{\"url\":\"https://rcs.10086.cn/\",\"application\":\"webview\"}}}},{\"action\":{\"displayText\":\"打开链接(默认浏览器)\",\"postback\":{\"data\":\"open_url_browser\"},\"urlAction\":{\"openUrl\":{\"url\":\"https://rcs.10086.cn/\",\"application\":\"browser\"}}}},{\"action\":{\"displayText\":\"上报当前位置\",\"postback\":{\"data\":\"set_by_chatbot_request_location_push\"},\"mapAction\":{\"requestLocationPush\":{}}}}]}}}}",
            "suggestions": "{\"suggestions\":[{\"reply\":{\"displayText\":\"上行YES\",\"postback\":{\"data\":\"YES\"}}},{\"action\":{\"displayText\":\"打开链接(系统自带浏览器)\",\"postback\":{\"data\":\"open_url_browser\"},\"urlAction\":{\"openUrl\":{\"url\":\"https://rcs.10086.cn/\",\"application\":\"browser\"}}}}]}",
            "sms": "true",
            "smsContent": "欢迎体验5G消息回落,这是一条回落消息",
            "mms": "false",
            "mmsFilePath": "",
            "mmsFileSize": 0,
            "mmsFileExpired": "0001-01-01T00:00:00Z",
            "createAt": "2024-04-03T14:14:56+08:00",
            "updateAt": "2024-04-03T14:14:56+08:00",
            "del": 0,
            "checked": 1,
            "api": 1,
            "ipAddress": "124.78.57.249",
            "rejectReason": ""
        }
    ]
}


失败返回
{
  "status":"error",
  "code":"2xxx",
  "msg":"错误信息描述"
}