salesmartly_webhook
    • Webhook接受消息接口文档
    • Webhook接受事件接口文档
    • 主动发送信息接口文档
    • 数据模型
      • LineSendRequest
      • LineVideoTemplate
      • LineAudioTemplate
      • LineSendResponse
      • LineUserMessageBase
      • LineVideoUserMessage
      • LineAudioUserMessage
      • LineReplyBase
      • LineVideoReply
      • LineAudioReply

    主动发送信息接口文档

    一、发送消息#

    1.概述#

    需根据本产品的规范,对添加的 Salesmartly 接口地址,实现一个 post 请求接口。
    Post 请求用于:推送信息到配置的 Salesmartly 接口地址。

    2. 配置参数#

    url(String):Salesmartly 接口地址。
    signature(String):用于使 Salesmartly 接口验证本信息有效性。
    data(Json):需要推送的消息

    3. 调用 Salesmartly 接口地址#

    当需要发送新信息时,调用 Salesmartly 接口地址进行消息推送。
    Post 请求,Whatsapp Api 接口地址(仅支持发送24小时服务窗口内的客户):
    https://webhook.salesmartly.com/whatsapp/send
    Post 请求,Messenger 接口地址(客户最后一条消息超过24小时,回复时需要加上tag字段):
    https://webhook.salesmartly.com/messenger/send
    Post 请求,Line 接口地址:
    https://webhook.salesmartly.com/line/send
    Post 请求,Whatsapp App 接口地址:
    https://webhook.salesmartly.com/individual_whatsapp/send
    Post 请求,Instagram 接口地址(客户最后一条消息超过24小时,回复时需要加上tag字段):
    https://webhook.salesmartly.com/instagram/send
    Post 请求,Plugin 接口地址:
    https://webhook.salesmartly.com/plugin/send
    Post 请求,Telegram App 接口地址:
    https://webhook.salesmartly.com/telegram_app/send
    Post 请求,Line App 接口地址:
    https://webhook.salesmartly.com/line_app/send
    Post 请求,企微接口地址:
    https://webhook.salesmartly.com/wecom/send
    Post 请求,TikTok App接口地址:
    https://webhook.salesmartly.com/tiktok_app/send
    Post 请求,TikTok 商业号接口地址:
    https://webhook.salesmartly.com/tiktok_business/send
    Post 请求,Telegram Bot接口地址:
    https://webhook.salesmartly.com/telegram/send
    Post 请求,X App接口地址:
    https://webhook.salesmartly.com/twitter_app/send
    Post 请求,Zalo App接口地址:
    https://webhook.salesmartly.com/zalo_app/send
    Post 请求,Slack接口地址:
    https://webhook.salesmartly.com/slack/send
    Post 请求,VK接口地址:
    https://webhook.salesmartly.com/vkontakte/send
    Post 请求,YouTube接口地址:
    https://webhook.salesmartly.com/youtube/send
    Post 请求,微信客服接口地址:
    https://webhook.salesmartly.com/work_weixin/send
    Post 请求,Email接口地址:
    https://webhook.salesmartly.com/email/send

    3.1 请求地址及参数#


    请求地址:http(s)://host?timestamp=TIMESTAMP&signature=webhook_token 地址中携带的参数含义与上述一致。
    3401bad0537f483be41d322d20b13d48.png
    Header
    content-type: “application/json”
    Query
    参数名参数类型参数含义
    signatureStringwebhook_token
    timestampString时间戳
    Body
    参数名参数类型参数含义
    dataJson新消息的数据体

    3.2 data的数据格式#


    消息格式
    参数名参数类型参数含义
    msg_type *String默认为3
    msg *Object消息内容
    chat_user_id *String用户id
    chat_session_id *String会话id
    send_time *String消息发送时间
    tagStringHUMAN_AGENT(用于Instagram和Messenger渠道 24 小时窗口外、7 天内的人工回复)

    3.3 输入示例#


    示例1 回复文本消息#
    {
        "data":{
            "msg_type":3,
            "msg":{
                "template1":{
                    "text":"\u60a8\u9009\u62e9\u5546\u54c1\u662f\u624b\u5957\uff0c\u94fe\u63a5\uff1ahttps://ss.com"
                },
                "template2":{
                    "text":"\u60a8\u9009\u62e9\u5546\u54c1\u662f\u624b\u5957\uff0c\u94fe\u63a5\uff1ahttps://ss.com"
                },
                // 最多支持五个template
            },
            "chat_user_id":"6537425481afde78d31e7651",
            "chat_session_id":"130925",
            "send_time":"1695799154645",
            "channel":1
        }
    }
    示例2 回复文本按钮消息(Whatsapp App,Telegram App,Plugin,Line app,企微,TikTok App,TikTok 商业号,Telegram Bot,X App,Zalo App,Slack,VK,YouTube,微信客服,Email,和Instagram渠道不支持)#
    {
        "data":{
            "msg_type":3,
            "msg":{
                "template1":{
                    "title":"\u6930\u5b50\u997c\u5e72ok\u561b1",
                    "buttons": {
                        "button1":{
                            "id":"ACT:1",
                            "text" : "choose"
                        }
                    }
                },
                "template2":{
                    "title":"\u6930\u5b50\u997c\u5e72ok\u561b2",
                    "buttons": {
                        "button1":{
                            "id":"ACT:2",
                            "text" : "choose"
                        }
                    }
                },
                // 最多支持五个template
            },
            "chat_user_id":"65094291e106072b7e40ff21",
            "chat_session_id":"130925",
            "send_time":"1695799154645",
            "channel":2
        }
    }
    示例3 回复图片+文本按钮消息(Whatsapp App,Telegram App, Plugin,Line app,企微和Instagram渠道不支持)#
    {
        "data":{
            "msg_type":3,
            "msg":{
                "template1":{
                	"image":"https://ss.com",
                    "title":"\u6930\u5b50\u997c\u5e72ok\u561b1",
                    "buttons": {
                        "button1":{
                            "id":"ACT:1",
                            "text" : "choose"
                        }
                    }
                },
                "template2":{
                	"image":"https://ss.com",
                    "title":"\u6930\u5b50\u997c\u5e72ok\u561b2",
                    "buttons": {
                        "button1":{
                            "id":"ACT:2",
                            "text" : "choose"
                        }
                    }
                },
                // 最多支持五个template
            },
            "chat_user_id":"65094291e106072b7e40ff21",
            "chat_session_id":"130925",
            "send_time":"1695799154645",
            "channel":2
        }
    }
    示例4 回复图片+文本消息#
    {
        "data":{
            "msg_type":3,
            "msg":{
                "template1":{
                    "image":"https://ss.com",
                    "text":"\u60a8\u9009\u62e9\u5546\u54c1\u662f\u624b\u5957\uff0c\u94fe\u63a5\uff1ahttps://ss.com"
                },
                "template2":{
                    "image":"https://ss.com",
                    "text":"\u60a8\u9009\u62e9\u5546\u54c1\u662f\u624b\u5957\uff0c\u94fe\u63a5\uff1ahttps://ss.com"
                },
                // 最多支持五个template
            },
            "chat_user_id":"65094291e106072b7e40ff21",
            "chat_session_id":"130925",
            "send_time":"1695799154645",
            "channel":7
        }
    }
    示例5 回复商品轮播消息(仅支持Messenger和line渠道)#
    {
        "data":{
            "msg_type":27,
            "msg":{
                "template":{
                    "generic":[
                      {
                        "title":"Welcome!",
                        "image_url":"https://petersfancybrownhats.com/company_image.png",
                        "subtitle":"We have the right hat for everyone.",
                        "buttons":[
                          {
                              "id":"ACT:1",
                              "text":"Start Chatting"
                          } // 最多支持三个button              
                        ]      
                      } // 最多不超过十个generic
                    ]
                }
            },
            "chat_user_id":"65094291e106072b7e40ff21",
            "chat_session_id":"130925",
            "send_time":"1695799154645",
            "channel":2
        }
    }
    示例6 回复文件消息(仅支持Whatsapp Api,Telegram App,Whatsapp App,Plugin,Telegram Bot,X App,Zalo App,Slack,微信客服,和Messenger)#
    {
        "data":{
            "msg_type":3,
            "msg":{
                "template1":{
                    "file":"https://www.com/company_image.txt"
                },
                "template2":{
                    "file":"https://www.com/company_image.txt"
                },
                // 最多支持五个template
            },
            "chat_user_id":"6537425481afde78d31e7651",
            "chat_session_id":"130925",
            "send_time":"1695799154645",
            "channel":1
        }
    }
    示例7 发送视频消息(支持Messenger、聊天插件、Instagram、Line、WhatsApp Api、WhatsApp APP、Telegram App、TikTok App、Telegram Bot、X App、Zalo App、Slack、微信客服渠道)#
    {
        "data":{
            "msg_type":3,
            "msg":{
                "template1":{
                    "video":"https://www.com/company_video.mp4"
                },
                "template2":{
                    "video":"https://www.com/company_video.mp4"
                },
                // 最多支持五个template
            },
            "chat_user_id":"65094291e106072b7e40ff21",
            "chat_session_id":"130925",
            "send_time":"1695799154645",
            "channel":1
        }
    }
    示例8 发送音频消息(支持Messenger、聊天插件、Instagram、Line、WhatsApp Api、WhatsApp APP、Telegram App、Telegram Bot、X App、Slack渠道)#
    {
        "data":{
            "msg_type":3,
            "msg":{
                "template1":{
                    "audio":{
                        "url":"https://www.com/company_audio.m4a",
                        "duration":12
                    }
                },
                "template2":{
                    "audio":{
                        "url":"https://www.com/company_audio.m4a",
                        "duration":12
                    }
                },
                // 最多支持五个template
            },
            "chat_user_id":"65094291e106072b7e40ff21",
            "chat_session_id":"130925",
            "send_time":"1695799154645",
            "channel":1
        }
    }
    示例9 回复 YouTube 一级评论#
    {
      "data": {
        "chat_user_id": "对应会话的用户ID",
        "msg": {
          "template1": {
            "text": "感谢您的评论",
            "reply_sequence_id": "123456"
          }
        }
      }
    }
    示例10 发送邮件#
    {
      "data": {
        "chat_user_id": "对应邮件会话的用户ID",
        "msg": {
          "template1": {
            "email": {
              "title": "邮件主题",
              "msg": "<p>邮件正文</p>"
            }
          }
        }
      }
    }
    示例11 发送群消息#
    {
      "data": {
        "chat_user_id": "使用群消息或群事件回调返回的群会话id",
        "msg": [
          {
            "text": "发送到群里的消息"
          }
        ]
      }
    }

    4. 返回#

    正常返回
    {
        "code":0,
        "msg":"具体消息"
    }
    异常返回
    {
        "code":-1,
        "msg":"错误原因"
    }
    content-type:”application/json”
    修改于 2026-11-11 08:39:54
    上一页
    Webhook接受事件接口文档
    下一页
    LineSendRequest
    Built with