Stella Platform Documentation

Stella Platform Documentation

  • Docs
  • Procedures
  • Reference
  • FAQ
  • Bot API
  • API
  • Languages iconEnglish
    • 中文

›Channels

Overview

  • Documentation Guide

Get Started

  • Introduction
  • Recent Updates
  • Best Practices
  • Chatbot Template

Bot Builder

  • Workspace
  • Node
  • Attachment ID

Node Inspector

  • Tree ID & Composite ID
  • Basic Information
  • Triggers
  • Responses
  • Actions
  • Redirect
  • Member Tagging
  • Analytics
  • NLP
  • Advance

Facebook

  • Message Types
  • Button Types
  • Persistent Menu
  • Access Token
  • One-Time Notification
  • N-Time Notification (Beta)

Instagram

  • Message Types

WhatsApp

  • Overview
  • Setup Procedure
  • Message Types

Web Chat

  • Overview
  • Message Types
  • Button Types

WeChat

  • Message Types

Slack

  • Message Types

Telegram

  • Message Types

Integrations

  • Dialogflow
  • Stripe
  • LUIS
  • Custom Inbox Integration

Data Source

  • Data Source

Media Library

  • Media Library

Channels

  • Overview
  • Webhooks
  • Channel-wide Metadata
  • Business Availability
  • Facebook
  • Instagram
  • Web Chat
  • WhatsApp
  • WeChat
  • Slack (Public App)
  • Slack (Custom App)
  • Teamwork
  • Zendesk
  • Custom Platform

Analytics

  • Members
  • Dashboard
  • PSID

Settings

  • Overview
  • Locale
  • Pairing Channels
  • Role-based Access Control
  • Access Token
  • Audit Trail

Push Panel

  • Push Content
  • Audience
  • Analytics

Log

  • Log

Connect to Custom Platform

Introduction

Stella allows you to integrate with a custom platform and custom livechat system. The clients and agents can stay on their own platform, and talk to each other indirectly in livechat.

Inlet: The platform where clients, customers or users can interact with the chatbot. Optionally the client can enter livechat with the outlet platform.

Outlet: The platform where agents, customer service team or admins can answer client’s livechat request. There may be minimal chatbot interaction in the form of commands.

For the custom platform, users need to host the web chat service themselves and build their own UI.

How does it work?

When a client from the inlet platform requests a livechat, we will send a livechat request to the Livechat API. The custom livechat system should handle the livechat request (such as creating a new ticket, delivering the ticket to a specific group, assigning an agent to the ticket, or other procedure that fits the system).

To see how you can request livechat in Stella, please refer to the sample code below:

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 })
 })

The livechat system should send any admin replies to Stella via Webhook API, with the sendToInlet field. We will then relay the replies to the client in inlet platform.

On the other hand, when a client sends messages to the inlet bot, we will relay the messages to the outlet platform through the Relay API.

If the admin is triggering the chatbot flow, usually by typing commands, a request should be sent to the Webhook API with the sendToBot field. We will send any chatbot responses to the Send API.

Webhook API

Webhook API is the entry point of chatbot service of Sanuker. The custom platform should send a request to the Webhook API when the user type messages, click buttons, or interact with the bot in other ways. The custom platform should specify whether to send the event to bot logic, or to relay the message to the corresponding user in their inlet platform.


Documentation of requesting webhook API will be listed below:

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

Livechat API

Prepare API for Stella to send livechat request from inlet user. The API path will be saved in channel.info.livechatApi. When a user triggers the livechat event, we will send the following body as JSON to the Livechat API (only important fields are listed below):

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

Relay API

Prepare API for Stella to relay client message to the corresponding livechat conversation. The API path will be saved in channel.info.relayResponseApi. When an inlet user send messages after triggering livechat, we will send the following body as JSON to the Relay API (only important fields are listed below):

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

For the error case, Stella will send the original message to the live chat tree of the channel, with the field relayMessageError containing the messages that cannot be sent to live chat. A Global node, with a trigger with condition this.messageEvent.relayMessageError, should be added to the live chat tree to capture this error. Any necessary actions or responses can be implemented in the nodes in the live chat tree to handle the error if needed.


Send API

Prepare API for Stella to send response to a specific user or conversation. If the conversationId is provided, the response should be sent to the conversation, otherwise the response should be sent to the member. The API path will be saved in channel.info.sendResponseApi. We will send the following body as JSON to the Send API (only important fields are listed below):

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

Connect to Custom Channel

  1. In "Channels", create a new channel.
  1. In "Platform", select "Custom" as the deployment platform.
Platform in Channels
  1. Then, "Custom Info" will be displayed below.
Custom Info
  1. Enter the endpoint URLs in "Custom Info".
Sample Endpoint URLs
← ZendeskMembers →
  • Introduction
    • How does it work?
  • Webhook API
  • Livechat API
  • Relay API
  • Send API
  • Connect to Custom Channel
Stella Platform Documentation
Docs
Get StartedBot API ReferenceAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2023 Sanuker Inc. Limited