You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Global-sales/doc/waba.template.md

2.3 KiB

发送template 消息

模板原文

{
    "wabaId": "190290134156880",
    "name": "order_updated_specialist_assigned_sharon",
    "language": "en",
    "messageSendTtlSeconds": -1,
    "components": [
        {
            "type": "BODY",
            "text": "Hi {{customer_name}}, this is {{your_name1}} your trip advisor. \nHow are you?   {{free_style}} \nKindest regards, {{your_name2}}. ",
            "example": {
                "body_text": [
                    [
                        "Mike",
                        "Coco",
                        "I'm following up on your itinerary",
                        "Coco2"
                    ]
                ]
            }
        }
    ],
    "category": "UTILITY",
    "status": "APPROVED",
    "qualityRating": "UNKNOWN",
    "reason": "NONE",
    "createTime": "2024-12-11T08:31:11.290Z",
    "updateTime": "2024-12-11T08:31:34.610Z",
    "statusUpdateEvent": "APPROVED"
}

发送模板消息, 数据结构

{
  "action": "message", // 固定值
  "actionId": "190.3c8322de-68df-4f9e-be8e-d92e7a13b7d7", // .uuid()
  "renderId": "190.3c8322de-68df-4f9e-be8e-d92e7a13b7d7", // 忽略
  "externalId": 190, // 留空
  "to": "8613557032060",
  "from": "+8617607730395",
  "msgtype": "template", // 固定值
  "msgcontent": {
    "name": "order_updated_specialist_assigned_sharon", // 模板名称. 从原文
    "language": {
      "code": "en" // 语言. 从原文
    },
    "components": [ // 没有参数的组件, 建议不传. 组件顺序也会报错
      {
        "type": "body", 
        "parameters": [ // 模板参数. 按 当前 `type` 中的参数顺序排列
          {
            "type": "text",
            "text": "test OT 22" // 参数值: 不能换行, 连续空格<4个
          },
          {
            "type": "text",
            "text": "yoyo"
          },
          {
            "type": "text",
            "text": "111"
          },
          {
            "type": "text",
            "text": "yoyo"
          }
        ],
        "text": "Hi test OT 22, this is yoyo your trip advisor. \nHow are you?   111 \nKindest regards, yoyo. " // 拼接一个完整内容
      }
    ]
  },
  "opi_sn": "404", // 发送人 ID
  "coli_sn": 1082591,
  "conversationid": 190 // 忽略
}