Stella Platform Documentation

Stella Platform Documentation

  • 文档
  • 标准设置程序
  • 参考
  • 常见问题
  • Bot API
  • 接口
  • Languages icon中文
    • English

›频道

概览

  • 文档指南

开始使用

  • 介绍
  • 更新历程
  • 最佳实践
  • 聊天机器人范本

聊天机器人制作平台

  • 工作区域
  • 对话点
  • 附件ID

对话点资讯区

  • Tree ID和Composite ID
  • 基本资讯
  • 触发点
  • 响应
  • 执行动作
  • 重定向
  • 会员标记
  • 数据分析
  • 自然语言处理
  • 进阶

脸书

  • 消息类型
  • 按钮类型
  • 固定菜单
  • 访问令牌
  • 一次性通知
  • 多次通知 (测试版)

Instagram

  • 消息类型

WhatsApp

  • 概览
  • 设定步骤
  • 消息类型

网站聊天室插件

  • 概览
  • 消息类型
  • 按钮类型

微信

  • 消息类型

Slack

  • 消息类型

Telegram

  • 消息类型

集成

  • Dialogflow
  • Stripe
  • LUIS
  • 自定义收件箱集成

数据库

  • 数据库

媒体库

  • 媒体库

频道

  • 概览
  • 网络钩子
  • 频道元数据
  • 營業時間
  • 脸书
  • Instagram
  • 网站聊天室插件
  • WhatsApp
  • 微信
  • Slack(公共应用程式)
  • Slack(自定义应用程式)
  • Teamwork
  • Zendesk
  • 自定义平台

数据分析

  • 会员
  • 分析报表版
  • PSID

设定

  • 概览
  • 语言
  • 配对频道
  • 设置访问控制
  • 访问令牌
  • 追踪设置记录

聊天机器人推送平台

  • 推送内容
  • 目标受众
  • 数据分析

Log

  • 后台记录

网络钩子

请确保您的核心版本为 v2.2 或更高版本,以便应用 webhooks。 您可以在频道的“树”->“设置”中查看核心版本。

## 验证

所有 webhook 事件都将在标头中带有签名(“X-Stella-Signature”)以进行验证。 可以使用以下方法验证每个 webhook 事件。

  1. 使用 HMAC-SHA256 算法,以通道密钥作为密钥,计算请求正文的摘要。
  2. 确认 Base64 编码的摘要与 X-Stella-Signature 请求头中的签名匹配。

入站消息

Stella 会以 2 种形式将它接收到的所有事件中继到您指定的 webhook。

原始入站消息

通过订阅此 webhook,您将收到我们正在接收的原始事件。 请注意,在 Messenger 上,事件结构与从 Messenger 接收到的原始事件(它是一个数组)略有不同。

来自 WhatsApp 的示例

文本

{
  "contacts": [
    {
      "profile": {
        "name": "Roy"
      },
      "wa_id": "85260903521"
    }
  ],
  "messages": [
    {
      "from": "85260903521",
      "id": "ABGGhSYJA1IfAgo6qRe8bWPLEpxD",
      "text": {
        "body": "Hello"
      },
      "timestamp": "1599536864",
      "type": "text"
    }
  ]
}

视频

{
  "contacts": [
    {
      "profile": {
        "name": "Roy"
      },
      "wa_id": "85260903521"
    }
  ],
  "messages": [
    {
      "from": "85260903521",
      "id": "ABGGhSYJA1IfAgo6koySp3Sro3ro",
      "timestamp": "1599537042",
      "type": "video",
      "video": {
        "id": "e8a85916-2386-49dc-8f05-1cd0527bfb68",
        "mime_type": "video/mp4",
        "sha256": "586cc370c535661c16e662f9cd2987215a878efd929073230de7cf5ec0c867ff"
      }
    }
  ]
}

标准化入站消息

通过订阅此 webhook,您将收到 Stella 为所有支持平台预处理的规范化事件。

来自 WhatsApp 的示例

文本

{
  "from": "85260903521",
  "to": "85268227287",
  "timestamp": "1599536864",
  "type": "TEXT",
  "data": {
    "text": "Hello"
  }
}

视频

{
  "from": "85260903521",
  "to": "85268227287",
  "timestamp": "1599536864",
  "type": "MISC",
  "data": {
    "attachments": [{
      "type": "VIDEO",
      "waMediaId": "e8a85916-2386-49dc-8f05-1cd0527bfb68",
    }],
  }
}

出站消息

机器人回复的消息

当成员(最终用户)liveChat 属性为false 时,Stella 会将聊天机器人发送的消息发送到您指定的 webhook。

手动消息

通过 Stella sendResponse API 发送的所有消息也将作为类型“MANUAL”发送到您指定的 webhook。

中继消息

当成员(最终用户)liveChat 属性为true 时,Stella 会将消息转发到相应的配对频道,并且这些消息将作为类型 ``RELAY发送到您指定的 webhook.

身体

PropertyTypeDescription
typeStringCan be either BOT, MANUAL or RELAY. Indicating whether the outbound message is from the chatbot or from API
messageEventObjectmessageEvent object container the normalised message
appStringID of the app
channelStringID of the chanel

消息事件

PropertyTypeDescription
fromStringID of the sender
toStringID of the receipient
timestampNumberUnix timestamp
typeStringMessage type*
dataObjectMessage data for the corresponding message type*
messageIdStringMessage ID from the external platform (this property might not exists)

*Please refer to the official documentation for all the message types and the structure of the corresponding message data.

示例事件

{
  type: "BOT",
  app: "app-id",
  channel: "channel-id",
  messageEvent: {
    from: "1332323131312",
    to: "443232332323",
    timestamp: 1599093015000,
    type: "TEXT",
    data: {
      text: "Hello World"
    },
    messageId: "gBGHYoUiNWZwfwIJbtM1ryHfqTdp"
  }
}
← 概览频道元数据 →
  • 入站消息
    • 原始入站消息
    • 标准化入站消息
  • 出站消息
    • 机器人回复的消息
    • 手动消息
    • 中继消息
Stella Platform Documentation
Docs
Get StartedBot API ReferenceAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2023 Sanuker Inc. Limited