智能消息模板新增

1、概述

智能消息可以创建模板,且版式类型丰富。

2、接口地址

POST https://rcsapi.hanwg.com/aim/template/addAimTemplate

3、请求参数

3.1、请求路径参数

全局参数

3.2、请求头参数

接口权限校验

3.3、请求体参数

智能消息的模板由7个部分组成:模板信息(模板id+模板名称+模板备注),智能消息内容,携带动态参数,短信内容,支持的终端厂商,使用场景, 使用类别。

字段 数据类型 是否必有 描述
aimNumber string 模板编号
字符个数[1, 64],字母+数字,可自定义,未定义时汉武际平台默认生成UUID
name string 模板名称
文字个数[1, 17]
remark string 模板备注
templateType int 版式类型
  • 1:多图文
  • 2:横滑(类型1)
  • 3:图文
  • 5:图片轮播16:9(图片宽高比16:9)
  • 8:视频
  • 9:红包
  • 10:一般通知
  • 11:增强通知
  • 12:账单通知
  • 13:火车票
  • 16:图片轮播1:1(图片宽高比1:1)
  • 17:图片轮播48:65(图片宽高比48:65)
  • 26:横滑(类型2)
  • pages array[page] 的集合
    此字段是关于智能消息的内容显示
    params array[param] 携带动态参数
    smsContent string 智能消息短信内容
    1. 短信到达终端后,终端自动解析此短信中的短链地址生成可视化智能消息,若解析失败,则终端展示此短信;
    2. 可以携带变量
    3. 必带有短链地址${dh_rcs_aim},用于解析;
    4. 因部分终端可能拦截智能消息导致其进入短信拦截箱,为降低拦截率建议在短信内容中添加以下任一字样:“官方信息,谨防诈骗”、“官方信息,谨防失效”、“官方信息,防范诈骗”;
    5. 例:给您发送了一条消息,官方信息,谨防失效,点击即可查看:${dh_rcs_aim};
    6. 此字段内容不可携带签名
    7. 文字个数[1, 200];
    aimNoParseSms string 普通短信内容
    若发送时aimNoParseType=1,且未指定customSmsContent时,则会直接使用该值 最终由实际发送时的aimNoParseType填值,决定是否发送当前字段内容 该字段为空时,可以在发送时,通过发送协议的customSmsContent字段进行指定; 如果都为空,则会使用智能消息的短信内容,即smsContent或者发送协议的aimSmsContent
    注意:此字段内容不可携带签名
    factories array[int] 指定此消息支持的厂商
  • 1:华为
  • 2:小米
  • 5:荣耀
  • 6:魅族
  • 7:VIVO
  • 8:OPPO

    注意事项:

    1. OPPO、VIVO、HONOR仅支持点击事件类型:打开链接、打开快应用、打开APP、打开浏览器;若模板有其他点击事件类型,模板将不送审OPPO、VIVO、HONOR;

    2. 带动态参数的模板不支持送审VIVO;

    3. 当templateType = 5、16、17(图片轮播)时,VIVO厂商支持图片数量2~4张(其余厂商限制1~5张),若图片数量不在范围内则不支持送审VIVO;

    4. 部分厂商对素材图片最小像素有要求,使用像素较小的图片可能会导致部分厂商审核不通过。

  • useScene string 使用场景
    useType int 使用类别
  • 1:商用
  • 2:试商用(模板名称和消息标题必须带有“测试”字样,否则审核不通过)
  • smsSign string 条件 模板短信签名
    1. 签名不需携带‘【】’;
    2. 建议必填,模板发送时平台将自动在您模板内容中添加短信签名;如不需添加,需联系技术支持处理;
    3. 当factories含7(vivo),该字段不填,则模板不送审vivo;
    4. 如果该客户不存在默认签名或填写的签名以及默认签名未报备,则模板创建失败,短信签名不存在或不可用;
    5. 发送5G消息回落智能消息,若模板审核通过vivo,chatbot签名与该签名不一致,则默认使用该签名发送短信。

    例:

    智能消息模板参数

    4、请求示例

    4.1、多图文

    版式类型templateType = 1(多图文)
    支持厂商:华为、小米、OPPO、魅族、VIVO
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    ①图片+②标题+③图片+④文本 ①图片+②标题+③图片+④文本+⑤图片+⑥文本 ①图片+②标题+③图片+④文本+⑤图片+⑥文本+⑦图片+⑧文本

    例:content为4个

    {
      "aimNumber": "",
      "name": "天气资讯",
      "remark": "多图文测试",
      "templateType": 1,
      "pages": [
        {
          "contents": [
            {
              "type": 2,
              "position": 1,
              "srcType": 1,
              "src": "2f7c25c1f2ef4baa89d943aec2e8ff84",
              "actionType": 10,
              "action": {
                "target": "复制文本",
                "copyType": 2
              }
            },
            {
              "type": 1,
              "position": 2,
              "content": "采撷阳光,共沐风雨!",
              "textTitle": 1
            },
            {
              "type": 2,
              "position": 3,
              "srcType": 1,
              "src": "70dfe28fc04a45eaacb0e0b26002071b",
              "actionType": 8,
              "action": {
                "target": "http://www.weather.com.cn/forecast/",
                "merchantName": "上海天气"
              }
            },
            {
              "type": 1,
              "position": 4,
              "content": "上海今日天气,3~8度,空气质量优,西北风3~5级。",
              "textTitle": 0
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "给您发送了一条消息,谨防失效,点击即可查看:${dh_rcs_aim} ",
      "factories": [
        1,
        2,
        6
      ],
      "useScene": "天气预报",
      "useType": 1
    }

    4.2、横滑

    版式类型templateType =
  • 2(横滑类型1)
  • 26(横滑类型2)
  • 支持厂商:华为、OPPO、魅族、VIVO
    厂商枚举见factories
    pages: array[page]中的page 为2个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    横滑类型1的说明及示例:
    第一个page:①图片+②标题+③文本+④按钮
    第二个page:⑤图片+⑥标题+⑦文本+⑧按钮
    {
        "aimNumber": "",
        "name": "横滑测试",
        "remark": "横滑--打开链接--打开链接",
        "templateType": 2,
        "pages": [
            {
                "contents": [
                    {
                        "type": 2,
                        "position": 1,
                        "srcType": 1,
                        "src": "2f7c25c1f2ef4baa89d943aec2e8ff84"
                    },
                    {
                        "type": 1,
                        "position": 2,
                        "content": "全民拍-随手拍",
                        "textTitle": 1
                    },
                    {
                        "type": 1,
                        "position": 3,
                        "content": "欲知后事如何,请点击按钮,跳转百度,自己查。",
                        "textTitle": 0
                    },
                    {
                        "type": 4,
                        "position": 4,
                        "actionType": 1,
                        "action": {
                            "target": "https://www.baidu.com/",
                            "merchantName": "百度"
                        },
                        "content": "查看详情"
                    }
                ]
            },
            {
                "contents": [
                    {
                        "type": 2,
                        "position": 5,
                        "srcType": 1,
                        "src": "2f7c25c1f2ef4baa89d943aec2e8ff84"
                    },
                    {
                        "type": 1,
                        "position": 6,
                        "content": "为中秋留一盒月饼",
                        "textTitle": 1
                    },
                    {
                        "type": 1,
                        "position": 7,
                        "content": "春节来了,中秋还会远吗?远!",
                        "textTitle": 0
                    },
                    {
                        "type": 4,
                        "position": 8,
                        "actionType": 1,
                        "action": {
                            "target": "https://www.baidu.com/",
                            "merchantName": "百度"
                        },
                        "content": "查看详情"
                    }
                ]
            }
        ],
        "params": [],
        "smsContent": "给您发送了一条消息,谨防失效,点击即可查看:${dh_rcs_aim} ",
        "factories": [
            1,
            6,
            8
        ],
        "useScene": "内部测试",
        "useType": 1
    }
    横滑类型2的说明及示例:
    第一个page:①图片+②标题+③按钮
    第二个page:④图片+⑤标题+⑥按钮
    {
      "aimNumber": "",
      "name": "风景模板",
      "remark": "横滑类型2--打开链接--打开链接",
      "templateType": 26,
      "pages": [
        {
          "contents": [
            {
              "type": 2,
              "position": 1,
              "srcType": 1,
              "src": "884b113fe3af4039bc2ec85a5dd0f1a3"
            },
            {
              "type": 1,
              "position": 2,
              "content": "无限风光无限美好",
              "textTitle": 1
            },
            {
              "type": 4,
              "position": 3,
              "actionType": 8,
              "action": {
                "target": "https://you.ctrip.com/",
                "merchantName": "携程旅游"
              },
              "content": "去看风景"
            }
          ]
        },
        {
          "contents": [
            {
              "type": 2,
              "position": 4,
              "srcType": 1,
              "src": "0763da19e39bf07fdf935d01021e014b"
            },
            {
              "type": 1,
              "position": 5,
              "content": "令人称赞的地貌风景",
              "textTitle": 1
            },
            {
              "type": 4,
              "position": 6,
              "actionType": 1,
              "action": {
                "target": "https://you.ctrip.com/",
                "merchantName": "携程旅游"
              },
              "content": "去看看"
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "给您发送了一条智能消息,点击即可查看:${dh_rcs_aim}",
      "factories": [1, 8],
      "useScene": "场景",
      "useType": 2
    }

    4.3、图文

    版式类型templateType = 3(图文)
    支持厂商:华为、小米、OPPO、魅族、VIVO
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    ①图片+②标题+③文本+④按钮
    POST /aim/template/addAimTemplate HTTP/1.1
    Content-Type: application/json
    Accept: application/json
    Authorization: ZGgxODUyODplZjhjMjgwZGQwZDVlZTc3MTkyZDljNDA5ZWZiYmExZg==
    Date: 2023-02-16 15:03:44
    User-Agent: PostmanRuntime/7.31.0
    Postman-Token: f504212f-9bff-40e6-b598-4053e20ea51b
    Host: 172.18.1.104:31205
    Accept-Encoding: gzip, deflate, br
    Connection: keep-alive
    Content-Length: 1957
    
    {
      "aimNumber": "",
      "name": "图文测试",
      "remark": "图文--打开浏览器--打开浏览器",
      "useScene": "优选商品推荐",
      "useType": 1,
      "templateType": 3,
      "pages": [
        {
          "contents": [
            {
              "type": 2,
              "position": 1,
              "actionType": 8,
              "action": {
                "target": "https://mobile.modu.red/#/pageH5?pageId=61a302d9a55c48adb767d07eb129e30c&enterpriseId=4407173642096896",
                "merchantName": "年节甄选"
              },
              "srcType": 1,
              "src": "b57f262c05fe4f7aafec8bda4ddba2c3"
            },
            {
              "type": 1,
              "position": 2,
              "content": "年节甄选 | 品牌好物,真情优选",
              "textTitle": 1
            },
            {
              "type": 1,
              "position": 3,
              "content": "以礼待人,以礼处事。传承礼节文化,书写礼遇情谊。以至臻好物传递情谊祝福,将万般美好珍藏心间。愿您:年年如意 事事顺遂。",
              "textTitle": 0
            },
            {
              "type": 4,
              "position": 4,
              "actionType": 8,
              "action": {
                "target": "https://mobile.modu.red/#/pageH5?pageId=61a302d9a55c48adb767d07eb129e30c&enterpriseId=4407173642096896",
                "merchantName": "年节甄选"
              },
              "content": "查看详情"
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "品牌好物,真情优选。官方信息,谨防失效,点击即可查看:${dh_rcs_aim}",
      "factories": [
        1,
        2,
        6,
        8
      ]
    }

    4.4、图片轮播

    版式类型templateType =
  • 5(图片轮播16:9)
  • 16(图片轮播1:1)
  • 17(图片轮播48:65)
  • 支持厂商:华为、OPPO、VIVO
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    图片的个数:[1, 5],VIVO厂商支持图片数量2~4张
    例:2张轮播图(16:9),①图片+②图片+③标题+④文本+⑤按钮
    图片的位置依次排列
    {
      "aimNumber": "",
      "name": "轮播图测试",
      "remark": "轮播图测试--打开链接--打开链接",
      "useScene": "文化宣传",
      "useType": 1,
      "templateType": 5,
      "pages": [
        {
          "contents": [
            {
              "type": 2,
              "position": 1,
              "actionType": 10,
              "action": {
                "target": "复制内容1",
                "copyType": 2
              },
              "srcType": 1,
              "src": "b57f262c05fe4f7aafec8bda4ddba2c3"
            },
            {
              "type": 2,
              "position": 2,
              "actionType": 10,
              "action": {
                "target": "复制内容2",
                "copyType": 2
              },
              "srcType": 1,
              "src": "2f7c25c1f2ef4baa89d943aec2e8ff84"
            },
            {
              "type": 1,
              "position": 3,
              "content": "古代足球也疯狂,汉代皇帝多“球迷”",
              "textTitle": 1
            },
            {
              "type": 1,
              "position": 4,
              "content": "卡塔尔世界杯激战正酣,看头号铁杆“球迷”汉武帝如何“迷球”?",
              "textTitle": 0
            },
            {
              "type": 4,
              "position": 5,
              "actionType": 1,
              "action": {
                "target": "https://uat.dahantc.com/physicalExercise/20221206zhfb.html",
                "merchantName": "正在打开链接"
              },
              "content": "点击查看"
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "卡塔尔世界杯激战正酣,看头号铁杆“球迷”汉武帝如何“迷球”?官方信息,谨防失效,点击即可查看:${dh_rcs_aim}",
      "factories": [1, 8]
    }

    4.5、视频

    版式类型templateType =8(视频)
    支持厂商:华为、OPPO、VIVO
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    ①视频+②标题+③文本+④按钮
    {
      "aimNumber": "",
      "name": "视频测试",
      "remark": "视频—打开浏览器",
      "useScene": "新闻宣传",
      "useType": 1,
      "templateType": 8,
      "pages": [
        {
          "contents": [
            {
              "type": 3,
              "position": 1,
              "srcType": 1,
              "cover": "b57f262c05fe4f7aafec8bda4ddba2c3",
              "src": "66be3d340b4542848f818a5e763a4080"
            },
            {
              "type": 1,
              "position": 2,
              "content": "大汉三通获首个5G消息为主题亿元融资",
              "textTitle": 1
            },
            {
              "type": 1,
              "position": 3,
              "content": "“战投+战略合作伙伴+战略客户”的格局将助力大汉三通的战略升级和布局。点击下方按钮,查看详情:",
              "textTitle": 0
            },
            {
              "type": 4,
              "position": 4,
              "actionType": 8,
              "action": {
                "target": "https://uat.dahancloud.com/physicalExercise/rongzi.html",
                "merchantName": "新闻详情"
              },
              "content": "查看详情"
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "给您发送了一条消息,点击即可查看: ${dh_rcs_aim} ",
      "factories": [1,8]
    }

    4.6、红包

    版式类型templateType = 9(红包)
    支持厂商:华为、小米、OPPO、VIVO
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    ①图片+②文本+③标题+④文本+⑤按钮
    {
      "aimNumber": "",
      "name": "红包",
      "remark": "红包",
      "useScene": "优选商品推荐",
      "useType": 1,
      "templateType": 9,
      "pages": [
        {
          "contents": [
            {
              "type": 2,
              "position": 1,
              "actionType": 8,
              "action": {
                "target": "https://mobile.modu.red/#/pageH5?pageId=61a302d9a55c48adb767d07eb129e30c&enterpriseId=4407173642096896",
                "merchantName": "年节甄选"
              },
              "srcType": 1,
              "src": "2f7c25c1f2ef4baa89d943aec2e8ff84"
            },
            {
              "type": 1,
              "position": 2,
              "content": "大汉福利",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 3,
              "content": "年节甄选",
              "textTitle": 1
            },
            {
              "type": 1,
              "position": 4,
              "content": "以至臻好物,传递情谊祝福,将万般美好珍藏心间。点击即可领取礼品详单",
              "textTitle": 0
            },
            {
              "type": 4,
              "position": 5,
              "actionType": 8,
              "action": {
                "target": "https://mobile.modu.red/#/pageH5?pageId=61a302d9a55c48adb767d07eb129e30c&enterpriseId=4407173642096896",
                "merchantName": "年节甄选"
              },
              "content": "立即领取"
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "品牌好物,真情优选。谨防失效,点击即可查看:${dh_rcs_aim}",
      "factories": [1,2,8]
    }

    4.7、一般通知

    版式类型templateType =10(一般通知)
    支持厂商:华为、小米、OPPO、VIVO
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    参数对对数为3:1标题+2文本+(3文本+4文本) +(5文本+6文本)+(7文本+8文本)+9按钮+10按钮+11图片
    参数对对数为4:1标题+2文本+(3文本+4文本) +(5文本+6文本)+(7文本+8文本)+(9文本+10文本)+11按钮+12按钮+13图片
    例:参数对对数为3
    {
      "aimNumber": "",
      "name": "活动大礼包",
      "remark": "一般通知模板",
      "useScene": "发送",
      "useType": 1,
      "templateType": 10,
      "pages": [
        {
          "contents": [
            {
              "type": 1,
              "position": 1,
              "content": "大汉福利礼包活动大放送",
              "textTitle": 1
            },
            {
              "type": 1,
              "position": 2,
              "content": "春节自选大礼包",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 3,
              "content": "活动主题",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 4,
              "content": "万福鹤礼",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 5,
              "content": "活动时间",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 6,
              "content": "2022-12-10",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 7,
              "content": "活动地点",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 8,
              "content": "上海张江高科技园",
              "textTitle": 0
            },
            {
              "type": 4,
              "position": 9,
              "actionType": 10,
              "action": {
                "target": "查看礼包",
                "copyType": 2
              },
              "content": "点击查看"
            },
            {
              "type": 4,
              "position": 10,
              "actionType": 4,
              "action": {
                "target": "13253366521"
              },
              "content": "预约活动"
            },
            {
              "type": 2,
              "position": 11,
              "actionType": 1,
              "action": {
                "target": "https://mobile.modu.red/#/pageH5pageId=27ff9a6f3a31476688ca78d5978b7c3a&enterpriseId=4407173642096896",
                "merchantName": "春节礼包"
              },
              "srcType": 1,
              "src": "2f7c25c1f2ef4baa89d943aec2e8ff84"
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "给您发送了一条消息,谨防失效,点击即可查看:${dh_rcs_aim} ",
      "factories": [1, 2]
    }

    4.8、增强通知

    版式类型templateType =11(增强通知)
    支持厂商:华为、小米、OPPO、VIVO
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    参数对对数为2:1标题+2文本+3文本+4文本+(5文本+6文本)+(7文本+8文本)+9按钮+10按钮+11图片
    参数对对数为3:1标题+2文本+3文本+4文本+(5文本+6文本)+(7文本+8文本)+(9文本+10文本)+11按钮+12按钮+13图片
    参数对对数为4:1标题+2文本+3文本+4文本+(5文本+6文本)+(7文本+8文本)+(9文本+10文本)+(11文本+12文本)+13按钮+14按钮+15图片
    例:参数对对数为2
    {
      "aimNumber": "",
      "name": "专属特惠",
      "remark": "增强通知",
      "useScene": "秒杀提醒",
      "useType": 1,
      "templateType": 11,
      "pages": [
        {
          "contents": [
            {
              "type": 1,
              "position": 1,
              "content": "恭喜您,获得了专属特惠价!",
              "textTitle": 1
            },
            {
              "type": 1,
              "position": 2,
              "content": "老少皆宜的禾家盛宴礼包,原价200元",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 3,
              "content": "99.00",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 4,
              "content": "元",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 5,
              "content": "使用规则",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 6,
              "content": "指定网站进行购买",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 7,
              "content": "到期时间",
              "textTitle": 0
            },
            {
              "type": 1,
              "position": 8,
              "content": "2023.01.31",
              "textTitle": 0
            },
            {
              "type": 4,
              "position": 9,
              "actionType": 8,
              "action": {
                "target": "https://mobile.modo.club/#/pageH5?pageId=a065e5036a4c4f65b18409985aaad385&enterpriseId=3976193990169088",
                "merchantName": "更多优惠"
              },
              "content": "更多优惠"
            },
            {
              "type": 4,
              "position": 10,
              "actionType": 8,
              "action": {
                "target": "https://mobile.modo.club/#/pageH5?pageId=7698527d9fa94041a8003842360130a9&enterpriseId=3976193990169088",
                "merchantName": "立即购买"
              },
              "content": "立即购买"
            },
            {
              "type": 2,
              "position": 11,
              "actionType": 8,
              "action": {
                "target": "https://mobile.modo.club/#/pageH5?pageId=7698527d9fa94041a8003842360130a9&enterpriseId=3976193990169088",
                "merchantName": "前往购买"
              },
              "srcType": 1,
              "src": "2f7c25c1f2ef4baa89d943aec2e8ff84"
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "恭喜您,获得了专属特惠价!点击即可查看: ${dh_rcs_aim}",
      "factories": [1, 2, 8]
    }

    4.9、账单通知

    版式类型templateType = 12(账单通知)
    支持厂商:华为
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    参数对对数为2:1标题+2文本+3文本+4文本+(5文本+6文本)+(7文本+8文本)+9按钮+10按钮+11图片
    参数对的对数可选值2~8
    例:参数对对数为2

    例如:content为11个

    {
      "aimNumber": "",
      "name": "交易提醒",
      "remark": "账单通知",
      "useScene": "优选商品推荐",
      "useType": 1,
      "templateType": 12,
      "pages": [
        {
          "contents": [
            {
              "position": 1,
              "type": 1,
              "content": "测试交易提醒"
            },
            {
              "position": 2,
              "type": 1,
              "content": "您尾号为7283的账户支出"
            },
            {
              "position": 3,
              "type": 1,
              "content": "623.00"
            },
            {
              "position": 4,
              "type": 1,
              "content": "元"
            },
            {
              "position": 5,
              "type": 1,
              "content": "时间"
            },
            {
              "position": 6,
              "type": 1,
              "content": "2020年12月31日 18:00"
            },
            {
              "position": 7,
              "type": 1,
              "content": "类型"
            },
            {
              "position": 8,
              "type": 1,
              "content": "电子支付"
            },
            {
              "position": 9,
              "type": 1,
              "content": "金额"
            },
            {
              "position": 10,
              "type": 1,
              "content": "623.00"
            },
            {
              "position": 11,
              "type": 1,
              "content": "收款对象"
            },
            {
              "position": 12,
              "type": 1,
              "content": "大汉三通"
            },
            {
              "position": 13,
              "type": 4,
              "actionType": 4,
              "action": {
                "target": "15766666666"
              },
              "content": "联系客服"
            },
            {
              "position": 14,
              "type": 4,
              "actionType": 3,
              "action": {
                "target": "https://www.ctrip.com/",
                "merchantName": "同程旅行",
                "packageName": [
                  "com.tongcheng.android"
                ]
              },
              "content": "查看详情"
            },
            {
              "position": 15,
              "type": 2,
              "actionType": 3,
              "action": {
                "target": "https://www.ctrip.com/",
                "merchantName": "同程旅行",
                "packageName": [
                  "com.tongcheng.android"
                ]
              },
              "srcType": 1,
              "src": "2f7c25c1f2ef4baa89d943aec2e8ff84"
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "品牌好物,真情优选。谨防失效,点击即可查看:${dh_rcs_aim}",
      "factories": [1,2,8]
    }

    4.10、火车票

    版式类型templateType = 13(火车票)
    支持厂商:华为
    厂商枚举见factories
    pages: array[page]中的page 为1个
    contents: array[content]中的content的positon:从上到下、从左到右、从1开始序号表示position值
    例:
    {
      "aimNumber": "",
      "name": "交易提醒",
      "remark": "账单通知",
      "useScene": "优选商品推荐",
      "useType": 1,
      "templateType": 13,
      "pages": [
        {
          "contents": [
            {
              "position": 1,
              "type": 1,
              "content": "消息标题"
            },
            {
              "position": 2,
              "type": 1,
              "content": "消息内容"
            },
            {
              "position": 3,
              "type": 1,
              "content": "起点站"
            },
            {
              "position": 4,
              "type": 1,
              "content": "终点站"
            },
            {
              "position": 5,
              "type": 1,
              "content": "开车时间"
            },
            {
              "position": 6,
              "type": 1,
              "content": "到站时间"
            },
            {
              "position": 7,
              "type": 1,
              "content": "开车日期"
            },
            {
              "position": 8,
              "type": 1,
              "content": "列车号"
            },
            {
              "position": 9,
              "type": 1,
              "content": "到站日期"
            },
            {
              "position": 10,
              "type": 1,
              "content": "乘客信息"
            },
            {
              "position": 11,
              "type": 1,
              "content": "票价等级"
            },
            {
              "position": 12,
              "type": 1,
              "content": "座位等级"
            },
            {
              "position": 13,
              "type": 1,
              "content": "乘客姓名"
            },
            {
              "position": 14,
              "type": 1,
              "content": "票价"
            },
            {
              "position": 15,
              "type": 1,
              "content": "座位号"
            },
            {
              "position": 16,
              "type": 4,
              "actionType": 10,
              "action": {
                "target": "11",
                "copyType": 2
              },
              "content": "按钮名称"
            },
            {
              "position": 17,
              "type": 4,
              "actionType": 10,
              "action": {
                "target": "22",
                "copyType": 2
              },
              "content": "按钮名称"
            },
            {
              "position": 18,
              "type": 2,
              "srcType": 1,
              "src": "f78b8c8b668fg2v6hgu55",
              "actionType": 10,
              "action": {
                "target": "33",
                "copyType": 2
              }
            }
          ]
        }
      ],
      "params": [],
      "smsContent": "品牌好物,真情优选。谨防失效,点击即可查看:${dh_rcs_aim}",
      "factories": [1,2,8]
    }

    5、响应参数

    名称 数据类型 是否必有 描述
    code int 响应状态码
    desc string 响应描述
    result object 条件 响应内容
    需要:code = 0(请求成功)
    templateId string 平台模板编号
    与请求时的aimNumber一致
    time date 时间
    时间格式:yyyy-MM-dd HH:mm:ss
    factories array[int] 上传的模板最终支持的厂商

    6、响应示例

    HTTP/1.1 200 OK
    Content-Type: application/json
    Transfer-Encoding: chunked
    Date: Tue, 11 Jul 2023 06:32:40 GMT
    Connection: close
    {
      "code": 0,
      "desc": "请求成功",
      "result": {
        "templateId": "cd63cc5d1e074b5dacff4b02872c389f",
        "time": "2023-07-11 14:32:40",
        "factories": [
          1,
          2
        ]
      }
    }
    
    文档更新时间: 2025-12-17 10:24   作者:王超