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

  • 后台记录

连接到自定义平台

介绍

Stella 允许您与自定义平台和自定义实时聊天系统集成。客户和代理可以留在自己的平台上,并通过实时聊天间接相互交谈。

入口:客户、顾客或用户可以与聊天机器人交互的平台。可选地,客户可以通过插座平台进入实时聊天。

出口:座席、客户服务团队或管理员可以回答客户实时聊天请求的平台。命令形式的聊天机器人交互可能最少。

对于自定义平台,用户需要自己托管网络聊天服务并构建自己的 UI。

它是如何运作的?

当来自 inlet 平台的客户端请求实时聊天时,我们将向 Livechat API 发送实时聊天请求。自定义实时聊天系统应处理实时聊天请求(例如创建新工单、将工单交付给特定组、为工单分配代理或其他适合系统的程序)。

要了解如何在 Stella 中请求实时聊天,请参阅以下示例代码:

return new Promise(async (resolve) => {
   try {
     const result = await this.createAssignment({
       member: this.member,
       assignmentDetails: {
         summary: "summary",
         groupName: "groupName",
       },
       createGroup: {},
       history: true,
       label: "Label",
       meta: {}
     })
     console.log("Create Assignment result", result)
     this.member.botMeta.liveChat = true;
     this.member.group = result.groupId;
     this.member.createAssignmentSuccess = true;
     console.log("Create Assignment - Successfully created assignment");
    
   } catch (err) {
     console.log("Create Assignment - Fail to create assignment" + err);
     this.member.createAssignmentSuccess = false;
   }
 
   resolve({ member: this.member })
 })

实时聊天系统应该通过 Webhook API 向 Stella 发送任何管理员回复,并带有 sendToInlet 字段。 然后我们会将回复转发给入口平台中的客户端。

另一方面,当客户端向入口机器人发送消息时,我们将通过 Relay API 将消息中继到出口平台。

如果管理员正在触发聊天机器人流程,通常是通过键入命令,则应将请求发送到带有 sendToBot 字段的 Webhook API。 我们会将任何聊天机器人响应发送到 Send API。

Webhook API

Webhook API 是 Sanuker 聊天机器人服务的入口点。 当用户键入消息、单击按钮或以其他方式与机器人交互时,自定义平台应向 Webhook API 发送请求。 自定义平台应指定是将事件发送到机器人逻辑,还是将消息中继到其入口平台中的相应用户。


下面将列出请求 webhook API 的文档:

API Endpoint

MethodPath
POSThttps://bot.stellabot.com/v2.4/customWebhook

Query Params

KeyValue
accessTokenTo be provided
cChannel ID (can be found in Channels page)
aOrganisation ID (can be found in Settings page)

Header

KeyValue
Content-typeapplication/json

Body

FieldTypeRequiredDescription
profileObjectYesUser profile
externalIdStringYesUnique ID for user in custom platform
sendToBotObjectNoPass the message event to chatbot flow
sendToInletObjectNoRelay the message from admin to user

sendToBot

FieldTypeRequiredDescription
messageEventObjectYesMessage Object

messageEvent

FieldTypeRequiredDescription
fromStringYesUnique ID for user in custom platform
toStringNoUnique ID for conversation
typeStringYeseg. “PAYLOAD”, “TEXT”
dataObjectYesMessage Object (Example fields are listed below. Additional fields can be added as needed.)
timestampNumberYesTimestamp in ms

data

FieldTypeRequiredDescription
textStringNoText of the message
payloadStringNoPayload of the button

sendToInlet

FieldTypeRequiredDescription
responseObjectYesResponse Object
memberIdStringYesUnique ID for inlet user ( member._id from Livechat API)

Response

CodeDescription
200A successful bot flow or the message is successfully relayed to inlet user
500An error is encountered, with the Error object in body

实时聊天 API

为 Stella 准备 API 以发送来自入口用户的实时聊天请求。 API 路径将保存在 channel.info.livechatApi 中。 当用户触发 livechat 事件时,我们会将以下正文作为 JSON 发送到 Livechat API(下面仅列出重要字段):

body

FieldTypeDescription
memberObjectMember object of the user requesting livechat
assignmentDetailsObjectDetails of the livechat
chatHistoryURLString(Optional) Link for the chat history of the user
metaObject(Optional) Meta data of the livechat request

member

FieldTypeDescription
_idStringUnique ID for user on Stella
profileObjectUser profile
metaObjectMeta data of the user
botMetaObjectBot-related meta data of the user

assignmentDetails

FieldTypeDescription
summaryString(Optional) A summary of the livechat request that can be sent to the agent
groupNameString(Optional) A name that the outlet system will use to create the conversation group for admin

Response

CodeDescription
200Live chat request is successfully processed
>= 400Encounter error when processing the live chat request

中继API

为 Stella 准备 API 以将客户端消息中继到相应的实时聊天对话。 API 路径将保存在 channel.info.relayResponseApi 中。 当入口用户在触发实时聊天后发送消息时,我们会将以下正文作为 JSON 发送到 Relay API(以下仅列出重要字段):

body

FieldTypeDescription
responseObjectResponse object
memberObjectMember object of the inlet user
channelObjectChannel object of the outlet channel that the message is relaying to

For Response Object, you can refer to the message types.

member

FieldTypeDescription
_idStringUnique ID for user on Stella
profileObjectUser profile
metaObjectMeta data of the user
botMetaObjectBot-related meta data of the user

botMeta

FieldTypeDescription
tempDataObjectTemporary meta data of the user

channel

FieldTypeDescription
infoObjectInformation of the channel

Response

CodeDescription
200Message is successfully relayed to the live chat
>= 400Encounter error when sending the message to the live chat

对于错误情况,Stella 会将原始消息发送到频道的实时聊天树,其中包含无法发送到实时聊天的消息的字段 relayMessageError。 一个全局节点,带有一个条件为this.messageEvent.relayMessageError 的触发器,应该被添加到实时聊天树中以捕获这个错误。 如果需要,可以在实时聊天树中的节点中实施任何必要的操作或响应以处理错误。


发送 API

为 Stella 准备 API 以向特定用户或对话发送响应。 如果提供了 conversationId,则应将响应发送到对话,否则应将响应发送到成员。 API 路径将保存在 channel.info.sendResponseApi 中。 我们将以下正文作为 JSON 发送到 Send API(下面仅列出重要字段):

body

FieldTypeDescription
responseObjectResponse object
memberObjectMember object that the response is sent to
channelObjectChannel object
conversationIdString(Optional) Unique ID for conversation that the response is sent to (same as messageEvent.to in Webhook API)

For Response Object, you can refer to the message types.

member

FieldTypeDescription
externalIdStringUnique ID for user in custom platform (same as messageEvent.from in Webhook API)
profileObjectUser profile
metaObjectMeta data of the user
botMetaObjectBot-related meta data of the user

channel

FieldTypeDescription
infoObjectInformation of the channel

Response

CodeDescription
200Message is successfully relayed to the live chat
>= 400Encounter error when sending the message to the live chat

连接到自定义频道

  1. 在“频道”中,创建一个新频道。
  1. 在“平台”中,选择“自定义”作为部署平台。
平台
  1. 然后,下面将显示“自定义信息”。
自定义信息
  1. 在“自定义信息”中输入端点 URL。
示例端点 URL
← 前一个会员 →
  • 介绍
    • 它是如何运作的?
  • Webhook API
  • 实时聊天 API
  • 中继API
  • 发送 API
  • 连接到自定义频道
Stella Platform Documentation
Docs
Get StartedBot API ReferenceAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2023 Sanuker Inc. Limited