Stella Platform Documentation

Stella Platform Documentation

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

›Reference

Get Started

  • Introduction

Reference

  • Message Event
  • Node
  • Member
  • Channel
  • Integrations
  • Agenda Meta
  • Group
  • Methods
  • Radiate.js
  • Access Control List
  • Stella Open API

Methods

These are the methods that can be accessed by the word this. You can make use of the these method to perform different kinds of features like setting new agenda, sending emails, etc.

Example

const obj = { 'a': [{ 'b': { 'c': 3 } }] };

this.lodash.get(obj, 'a[0].b.c', null);
// => 3

3rd party library methods

PropertyTypeDescription
fetchfunctionNode-fetch (this.fetch) is a library for sending http(s) requests.
momentfunctionMoment (this.moment) is a library for time related logic. Please note that this method only supports moment.js but not moment-timezone or luxon.
lodashfunctionLodash is a utility library that improves QoL.

Custom methods provided by Stella



DB Notes

Stella use mongoDB as database. For any DB methods below, please see the mongoDB CRUD Operations documentation for reference. More specifically, you should refer to the mongoDB's "Query Document" section for the filter parameter. For the patch and withModifier parameters, you should refer to mongoDB's "Change a Document" section, where the patch object will be set as $set if withModifier is false, while setting withModifier to true will let you customize the update modifier, or to replace the document.

A findAndModify method is an atomic operation, ie. the "find" and "modify" happens at the same time. It is prefered to doing a "find" operation and a "modify" operation separately. It is used to prevent a critical action from happening more than once, even if the user spams the input or the external service sends multiple events at the same time, accidentally or purposefully. To achieve this, a filter and patch pair should be set so that the same entry won't be found after being modified. The example in findAndModifyMember shows how it works.



findAndModifyMember (Updated)

The method findAndModifyMember() is used to find and modify a member.

Parameter

NameTypeDescription
filterobjectFilter to find the member
patchobjectObject to be patched to the member
withModifierbooleanDefault true. see DB Notes for more details
sortByobjectOptional. Order to sort the members. Note: only the first member after sorting is found and modified by this method.
optionobjectOptional. Use { "new": true } to get the modified member. Please refer to mongoDB's Collection Methods for other options.


Example

this.findAndModifyMember({
  filter: {
    firstName: "John",
    "meta.checked": false,
  },
  patch: {
    "meta.checked": true,
  },
  withModifier: false,
  sortBy: {
    _id: -1,
  },
  option: {
    new: true,
  }
})


Response

NameTypeDescription
oknumber1 for successful call
memberobjectThe Member object found. If option.new is true, the modified member will be returned. Otherwise, the original member will be returned. Return null if no matched member is found.
{
  ok: 1,
  member: {
    _id: "m12345678901234567890123",
    app: "a12345678901234567890123",
    channel: "c12345678901234567890123",
    externalId: "1234567890",
    firstName: "John",
    lastName: "Doe",
    botMeta: {
      liveChat: false,
      subscribe: true,
      tempData: {},
      nodeCompositeId: "abcdefghijklmnop",
      tree: "t12345678901234567890123"
    },
    meta: {
      checked: true,
    },
    platform: "custom",
    tags: [],
    createdAt: 1577808000000,
    updatedAt: 1601481600000
  }
}



findAndModifyDataFromDataSource (Updated)

The method findAndModifyDataFromDataSource() is used to find and modify a data entry in a Data Source.

Parameter

NameTypeDescription
dataSourceIdstringData Source ID
filterobjectFilter to find the data entry
patchobjectObject to be patched to the data entry
withModifierbooleanDefault true. see DB Notes for more details
sortByobjectOptional. Order to sort the data entries. Note: only the first data entry after sorting is found and modified by this method.
optionobjectOptional. Use { "new": true } to get the modified data entry. Please refer to mongoDB's Collection Methods for other options.


Example

this.findAndModifyDataFromDataSource({
  dataSourceId: "a12345678901234567890123_coupon",
  filter: {
    location: "HK",
    memberId: null,
  },
  patch: {
    memberId: "m12345678901234567890123",
    deliveredAt: 1601481600000,
  },
  withModifier: false,
  sortBy: {
    priority: 1,
  },
  option: {
    new: true,
  }
})


Response

NameTypeDescription
oknumber1 for successful call
valueobjectThe data entry object found. If option.new is true, the modified data entry will be returned. Otherwise, the original data entry will be returned. Return null if no matched data entry is found.
{
  ok: 1,
  value: {
    _id: "d12345678901234567890123",
    location: "HK",
    couponCode: "1234",
    priority: 0,
    memberId: "m12345678901234567890123",
    deliveredAt: 1601481600000,
    createdAt: 1577808000000,
    updatedAt: 1601481600000
  }
}



upsertDataToDataSource (Updated)

The method upsertDataToDataSource() will upsert data entries in the Data Source. If _id exists in the data object, it will be upserted in the Data Source, ie. if a data entry with the same _id exists, the entry will be updated, else, a new data entry will be inserted. Otherwise, a new data entry will be inserted.

Parameter

NameTypeDescription
dataSourceIdstringData Source ID
dataobject or [object]Data to be updated or inserted


Please note that Stella core version v2.5 or above supports upsertDataToDataSource.

Example

this.upsertDataToDataSource({
  dataSourceId: "a12345678901234567890123_coupon",
  data: [{
    _id: "d12345678901234567890123", // exists in Data Source
    location: "HK",
    couponCode: "0123",
    priority: 1,
  }, {
    _id: "d12345678901234567890124", // not exists in Data Source
    location: "KLN",
    couponCode: "0124",
    priority: 2,
  }, {
    location: "NT",
    couponCode: "0125",
    priority: 3,
  }]
})


Response

NameTypeDescription
resultobjectResult object


Result

NameTypeDescription
_docsIdsobjectDocsIds object
matchednumberNumber of matched entries
modifiednumberNumber of modified entries
insertednumberNumber of inserted entries
deletednumber0


DocsIds

NameTypeDescription
updated[string]Array of _id of updated entries
inserted[string]Array of _id of inserted entries
upserted[string]Array of _id of inserted entries with _id provided
{
  result: {
    _docsIds: {
      updated: ["d12345678901234567890123"],
      inserted: ["d12345678901234567890125"],
      upserted: ["d12345678901234567890124"]
    },
    matched: 1
    modified: 1
    inserted: 2
    deleted: 0
  }
}



newAgenda (Updated)

The method newAgenda() can be used to create new agenda. Please refer here for reference on the Agenda system.

Parameter

NameTypeDescription
memberIdstringStella Member ID
treeIdstringTree ID
nodeCompositeIdstringNode Composite ID
nextRunAtnumberOverride pattern. Either nextRunAt or pattern is required. Timestamp for executing the agenda (Unix epoch time in milliseconds). The moment.js library can be used, eg. this.moment().add(5, "minutes").valueOf() gives the timestamp of 5 minutes from now.
patternstringEither nextRunAt or pattern is required. CRON Pattern of the agenda. If you wish to check the CRON pattern, you can use Crontab Guru
runUntilnumberRequired if pattern is used. The agenda will be executed following the pattern until the runUntil timestamp.
prioritynumberOptional. The priority of the agenda. Agenda with the smaller priority number will be executed first.
metaobjectOptional. The data associated with the agenda. This object can be accessed by this.agendaMeta when the agenda is executed.
replacebooleanDefault false. Set as true to replace agendas of the same member with the same tag.
tagstringRequired if replace is true. Agenda tag


Example

this.newAgenda({
  memberId: "m12345678901234567890123",
  treeId: "t12345678901234567890123",
  nodeCompositeId: "abcdefghijklmnop",
  nextRunAt: 1609430400000,
  priority: 1,
  meta: {
    testing: true
  },
  replace: true,
  tag: "testing-agenda"
})


Response

The agenda object created will be returned.

{  
  _id: "ag2345678901234567890123",
  app: "a12345678901234567890123",
  channel: "c12345678901234567890123",
  member: "m12345678901234567890123",
  tree: "t12345678901234567890123",
  nodeCompositeId: "abcdefghijklmnop",
  nextRunAt: 1609430400000,
  priority: 1,
  meta: {
    testing: true
  },
  tag: "testing-agenda",
  completed: false,
}



redirectMemberToNode (Updated)

The method redirectMemberToNode() is used to redirect a member to a node. The node will then be executed for the member according to the redirectOptions. For usage in Stella API, you may also refer to the Stella API documentation.

Parameter

NameTypeDescription
memberIdstringStella Member ID
channelIdstringChannel ID of the Member
treeIdstringTree ID
nodeCompositeIdstringNode composite ID
redirectOptionsobjectOptional. RedirectOptions Object
metaobjectOptional. The data associated with the node. This object can be accessed by this.agendaMeta when the node is executed.

RedirectOptions

NameTypeDescription
runPreActionbooleanDefault true. Whether the Pre Actions of the node is exectued.
sendResponsebooleanDefault true. Whether the Responses of the node is sent.
runPostActionbooleanDefault true. Whether the Post Actions of the node is exectued.

Example

this.redirectMemberToNode({
  memberId: "m12345678901234567890123",
  channelId: "c12345678901234567890123",
  treeId: "t12345678901234567890123",
  nodeCompositeId: "abcdefghijklmnop",
  redirectOptions: {
    runPreAction: false,
    sendResponse: true,
    runPostAction: true
  },
  meta: {
    testing: true
  }
})


Response

NameTypeDescription
oknumber1 for successful call
memberstringStella Member ID
sendResults[object]Array of NodeSendResult Object. The first entry represents the send results of the node. Any subsequence entries represent the send results of the nodes redirected from the original node.

NodeSendResult

NameTypeDescription
oknumber1 for successful call
memberstringStella Member ID
result[object]Array of SendResult Object. Each entry represents the send result of a response in the node.

SendResult

NameTypeDescription
resultobjectPlatform specific result to the actual send request. The example below shows the result from Facebook.
messageEventobjectMessage Event object. Please refer here for more details.
chatIdstringStella Chat ID
{
  ok: 1,
  member: "m12345678901234567890123",
  sendResults: [
    {
      ok: 1,
      member: "m12345678901234567890123",
      result: [
        {
          result: {
            recipient_id: "1234567812345678",
            message_id: "xxxxxxxxxxxxxxxx"
          },
          messageEvent: {
            from: "8765432187654321",
            to: "1234567812345678",
            data: {
              url: "https://s3.ap-southeast-1.amazonaws.com/radiate-admin/59bba4275a304100055da5bc/hello-min.gif",
              attachment_id: "2345678923456789",
              transform: ""
            },
            type: "IMAGE",
            timestamp: 1604160000000,
            messageId: "xxxxxxxxxxxxxxxx"
          },
          chatId: "ch2345678901234567890123"
        },
        {
          result: {
            recipient_id: "1234567812345678",
            message_id: "xxxxxxxxxxxxxxxx"
          },
          messageEvent: {
            from: "8765432187654321",
            to: "1234567812345678",
            data: {
              text: "Hello, I am Stella the Dog 🐶 ",
              transform: ""
            },
            type: "TEXT",
            timestamp: 1604160000001,
            messageId: "xxxxxxxxxxxxxxxx"
          },
          chatId: "ch2345678901234567890124"
        },
        {
          result: {
            recipient_id: "1234567812345678",
            message_id: "xxxxxxxxxxxxxxxx"
          },
          messageEvent: {
            from: "8765432187654321",
            to: "1234567812345678",
            data: {
              transform: "",
              quickReplies: [
                {
                  content_type: "text",
                  title: "Yes ❤️",
                  payload: "ONBOARDING"
                },
                {
                  content_type: "text",
                  title: "No ☠️",
                  payload: "MAIN_MENU"
                }
              ],
              text: "My master Sanuker can help you make bots on different platforms with my help, would you like to make one?"
            },
            type: "QUICK_REPLIES",
            timestamp: 1604160000002,
            messageId: "xxxxxxxxxxxxxxxx"
          },
          chatId: "ch2345678901234567890125"
        }
      ]
    }
  ]
}



createAssignment (Updated)

The method createAssignment() is used to request live chat for a member. The channel with the member requesting live chat is called the Inlet Channel. The Pairing Channels of the App are used to find the corresponding Outlet Channels for the Inlet Channel. The Broadcast Groups of the Outlet Channel are used with label to determine the Targets the live chat request is sending to. There is different behaviour when the live chat request is sending to different platform. For platforms that do not utilize ticketing, such as Zendesk and Custom channels, the live chat request will be directly sent to the channel, and all other targets will be ignored. Otherwise, tickets will be sent to all Broadcast Groups in all Target Channels. Please refer to the documentation on the specific platforms for more details.

Parameter

NameTypeDescription
memberobjectMember object. Use this.member for live chat request for the current member, or use the getMember method is get the member object for other member.
assignmentDetailsobjectAssignmentDetails Object
labelstringDefault "default". Broadcast group label
historybooleanDefault false. Whether the Stella conversation history url is attached to the live chat request.
targets[object]Optional. Override label. Array of Target Objects. Will override the Pairing Channels and Broadcast Groups settings.
metaobjectOptional. The data associated with the live chat request. This object can be accessed by the key meta in the assignment object of the live chat request.
createGroupobjectFor Custom channel only. CreateGroup object.
setLiveChatAgendabooleanDefault true. Whether the live chat agendas are created immediately.

AssignmentDetails

Note: For a custom outlet channel, the whole AssignmentDetails object will be sent to the Live Chat API. This field will become a blackbox and the below schema will be for reference only.

NameTypeDescription
summarystringOptional. Summary of the live chat request. Will be sent to the live chat conversation in Outlet Channel when the conversation is created.
groupNamestringOptional. Name of the live chat conversation created in Outlet Channel.
relayMessageobjectOptional. The key of this object should be the name of the platform of the targets, ie. "slack" or "zendesk". The value of this object is the relay message. For target that utilize ticketing, the relay message is the Response object of the ticket sent to the broadcast group. Otherwise, the relay message is the first message sent to the live chat conversation.

Target

NameTypeDescription
channelstringStella Channel ID
broadcastGroups[object]BroadcastGroup object
labelstringDefault "default". Broadcast group label

BroadcastGroup

NameTypeDescription
typestringType of the broadcast group. "zendesk" for Zendesk channel. "user", "public_channel" or "private_channel" for Slack channel.
idstringOptional. External ID of the broadcast group.

CreateGroup

NameTypeDescription
externalIdstringOptional. External ID of the live chat conversation.


Example

Example 1: Create Slack live chat request. Tickets will be sent to broadcast groups with the label "test".

this.createAssignment({
  member: this.member,
  assignmentDetails: {
    summary: `Name: ${this.member.firstName}\nSource: WhatsApp Live Chat`,
    groupName: `${this.member.firstName}_liveChat_`.toLowerCase(),
    relayMessage: {
      slack: {
        type: "BUTTON",
        text: `Request Live Chat: ${this.member.firstName}`,
        buttons: [{
          type: "postback",
          title: "待答覆",
          payload: {
            payload: "PICK_TICKET"
          }
        }]
      }
    }
  },
  label: "test",
  history: true,
  meta: {
    testing: true
  },
  setLiveChatAgenda: true
})

Example 2: Create Slack live chat request. Tickets will be sent to the destinated target groups.

this.createAssignment({
  member: this.member,
  assignmentDetails: {
    summary: `Name: ${this.member.firstName}\nSource: WhatsApp Live Chat`,
    groupName: `${this.member.firstName}_liveChat_`.toLowerCase(),
    relayMessage: {
      slack: {
        type: "BUTTON",
        text: `Request Live Chat: ${this.member.firstName}`,
        buttons: [{
          type: "postback",
          title: "待答覆",
          payload: {
            payload: "PICK_TICKET"
          }
        }]
      }
    }
  },
  history: true,
  targets: [
    {
      channel: "c12345678901234567890123",
      broadcastGroups: [
        {
          type: "public_channel",
          id: "C1234123412"
        },
        {
          type: "private_channel",
          id: "G1234123413"
        }
      ]
    },
    {
      channel: "c12345678901234567890124",
      broadcastGroups: [
        {
          type: "user",
          id: "U1234123414"
        },
        {
          type: "user",
          id: "U1234123415"
        }
      ]
    }
  ],
  meta: {
    testing: true
  },
  setLiveChatAgenda: true
})

Example 3: Create Zendesk live chat request. A new ticket will be created in the Zendesk platform.

this.createAssignment({
  member: this.member,
  assignmentDetails: {
    relayMessage: {
      zendesk: {
        type: "TEXT",
        text: `${this.member.firstName} - Enquiry from WhatsApp`,
      }
    }
  },
  label: "test-zendesk"
})

Example 4: Create live chat request on Custom channel. A POST request will be sent to the Live Chat API of the channel.

this.createAssignment({
  member: this.member,
  assignmentDetails: {
    summary: `Name: ${this.member.firstName}\nSource: WhatsApp Live Chat`,
    groupName: `${this.member.firstName}_liveChat_`.toLowerCase(),
  },
  label: "test-custom",
  history: true,
  createGroup: {}
})


Response

NameTypeDescription
memberobjectMember object
assignmentIdstringStella ID of the assignment created
groupIdstringApplied only when createGroup is set. Stella ID of the group created
{
  member: {
    _id: "m12345678901234567890123",
    app: "a12345678901234567890123",
    channel: "c12345678901234567890123",
    externalId: "1234567890",
    firstName: "John",
    lastName: "Doe",
    botMeta: {
      liveChat: true,
      subscribe: true,
      tempData: {},
      nodeCompositeId: "abcdefghijklmnop",
      tree: "t12345678901234567890123"
    },
    platform: "custom",
    tags: [],
    createdAt: 1577808000000,
    updatedAt: 1601481600000
  },
  assignmentId: "as2345678901234567890123",
  groupId: "g12345678901234567890123"
}



addNewTargetsToAssignment

The method addNewTargetsToAssignment() is used to add new broadcast groups to assignment for different channels.

Example

this.addNewTargetsToAssignment({ assignmentId: string, liveChat: boolean, targets: array<object> })


Parameter

NameTypeDescription
assignmentIdstringAssignment ID
liveChatbooleanDefault true Whether it is a live chat
targetsarrayA list of broadcast group object

Response

Promise<{ member: object, assignmentId: string }>

checkAndSaveMemberReferFrom

The method checkAndSaveMemberReferFrom() is used to check the information about the present channel.

Example

this.checkAndSaveMemberReferFrom({ memberId: string, referFrom: string })


Parameter

NameTypeDescription
memberIdstringStella Member ID
referFromstringChannel that refers member to the current channel

Response

{
  "_id": string
  "createdAt": timestamp
  "updatedAt": timestamp
  "platform": string
  "profile": object
  "meta": object
  "botMeta": object
  "externalId": string
  "botId": string
  "firstName": string
  "gender": string
  "app": string
  "channel": string
  "tags": array<object>
  "_version": number
}

countDataSource

The method countDataSource() is used to count the information about the present channel.

Example

this.countDataSource({ collectionName: string, dataSourceId: string, filter: object })


Parameter

NameTypeDescription
collectionNamestringEither collectionName or dataSourceId. Collection name
dataSourceIdstringEither collectionName or dataSourceId. Data source ID
filterobjectOptional Filter criteria. Shares the same method as MongoDB query. Please see MongoDB for further reference

Response

400 // A number

createTeamsChannel

The method createTeamsChannel() is used to create a Teamwork channel.

Example

this.createTeamsChannel({ channel: string, teamsGroupId: string, displayName: string })


Parameter

NameTypeDescription
channelobjectChannel collection object
teamsGroupIdstringTeamwork group ID
displayNamestringDisplay name of the new channel

Response

{
  "ok": 1
  "result": object
}

createWhatsappGroup

The method createWhatsappGroup() is used to create a WhatsApp group.

Example

this.createWhatsappGroup({ channelId: string, name: string, requireInvitationLink: string })


Parameter

NameTypeDescription
channelIdstringChannel ID
namestringGroup name
requireInvitationLinkbooleanDefault true. Status of the group require invitation link to join

Response

{
  "groupId": string
  "invitationLink": string // If requireInvitationLink === true
}

deleteMemberAgenda

The method deleteMemberAgenda() is used to delete member agenda by Stella member ID.

Example

this.deleteMemberAgenda({ memberId: string, tag: string })


Parameter

NameTypeDescription
memberIdstringStella Member ID
tagstringSpecific agenda name

Response

{
  "clientMutationId": string
}

disableWhatsappGroupInviteLink

The method disableWhatsappGroupInviteLink() is used to disable WhatsApp group invitation links.

Example

this.disableWhatsappGroupInviteLink({ externalId: string, channel: string })


Parameter

NameTypeDescription
channelobjectChannel collection object
externalIdstringGroup ID in WhatsApp

endLiveChat

The method endLiveChat() is used to end the live chat in different channels.

Example

this.endLiveChat({ channel: object, messageEvent: object })


Parameter

NameTypeDescription
channelobjectChannel collection object
messageEventobjectMessage Event object. Please see Message Event documentation for further reference.

endWhatsappLiveChat

The method endWhatsappLiveChat() is used to end the WhatsApp live chat.

Example

this.endWhatsappLiveChat({ adminExternalId: string, whatsappGroupId: string, channel: object, channelId: string })


Parameter

NameTypeDescription
adminExternalIdstringMember ID in WhatsApp
channelobjectChannel collection object
channelIdstringChannel ID
whatsappGroupIdstringWhatsApp group ID

Response

[
  {
    "clientMutationId": string
  },
  {
    "assignmentRaw": object
    "clientMutationId": string
  },
  // // ...
]

fbCreateBroadcast

The method fbCreateBroadcast() is used to create Facebook broadcast for mass promotion.

Example

this.fbCreateBroadcast({ channel: object, response: string })


Parameter

NameTypeDescription
channelobjectChannel collection object
responseobjectResponse object. The structure of the response object can be referred to the Message Event documentation for further reference.

Response

{
  "ok": 1
  "result": [
    {
      "response": object
      "accessToken": string
    }
  ]
}

fbGetAttachmentId

The method fbGetAttachmentId() is used to get Facebook attachment ID when uploading a new attachment.

Example

this.fbGetAttachmentId({ channel: object, type: string, url: string })


Parameter

NameTypeDescription
channelobjectChannel collection object
typeobjectAttachment type
urlstringAttachment URL

Response

{
  "attachment_id": string
}

fbPassThreadControl

The method fbPassThreadControl() is used to pass the conversation control from one app to another.

Example

this.fbPassThreadControl({ member: object, channel: object, targetAppId: string, metadata: string })


Parameter

NameTypeDescription
channelobjectChannel collection object
memberobjectMember collection object
metadatastringData need to be passed in passing the control
targetAppIdstringTarget application ID

Response

{
  "success": true
}

fbRemoveCustomLabel

The method fbRemoveCustomLabel() is used to remove a custom label from a PSID.

Example

this.fbRemoveCustomLabel({ member: object, channel: object, labelId: string })


Parameter

NameTypeDescription
channelobjectChannel collection object
memberobjectMember collection object
labelIdstringLabel ID

Response

{
  "success": true
}

fbSaveCustomLabel

The method fbSaveCustomLabel() is used to save a custom label from a PSID.

Example

this.fbSaveCustomLabel({ member: object, channel: object, labelId: string })


Parameter

NameTypeDescription
channelobjectChannel collection object
memberobjectMember collection object
labelIdstringLabel ID

Response

{
  "id": number
}

fbSendBroadcast

The method fbSendBroadcast() is used to send a broadcast message.

Example

this.fbSendBroadcast({ channel: object, broadcastId: "broadcastId", labelId: string, notificationType: string })


Parameter

NameTypeDescription
channelobjectChannel collection object
broadcastIdobjectBroadcast ID
labelIdstringLabel ID
notificationTypestringNotification Type

Response

{
  "broadcast_id": number
}

fetchDataFromDataSource

The method fetchDataFromDataSource() is used to fetch data from data source.

Example

this.fetchDataFromDataSource({ collectionName: string, dataSourceId: string , filter: object, count: boolean, sortBy: object })


Parameter

NameTypeDescription
collectionNamestringEither collectionName or dataSourceId. Collection name
countbooleanDefault false. Status of this method is performing count feature only
dataSourceIdstringEither collectionName or dataSourceId. Data source ID
filterobjectOptional Filter criteria. Shares the same method as MongoDB query. Please see MongoDB for further reference
sortByobjectOptional Shares the same method as MongoDB query. Please see MongoDB for further reference

Response

[
  {
    "id": string
    // ...
  },
  // ...
]

fetchDistinctDataFromDataSource

The method fetchDistinctDataFromDataSource() is used to fetch distinct data(i.e. the column of the data source table) from data source.

Example

this.fetchDistinctDataFromDataSource({ collectionName: string, dataSourceId: string , filter: object, count: boolean, sortBy: object })


Parameter

NameTypeDescription
collectionNamestringEither collectionName or dataSourceId. Collection name
countbooleanDefault false. Status of this method is performing count feature only
dataSourceIdstringEither collectionName or dataSourceId. Data source ID
keystringThe column you wish to fetch from data source
filterobjectOptional Filter criteria. Shares the same method as MongoDB query. Please see MongoDB for further reference

Response

[
  value of key,
  // ...
]

fetchGeoNearFromDataSource

The method fetchGeoNearFromDataSource() is used to fetch geographical data from data source.

Example

this.fetchGeoNearFromDataSource({ collectionName: string, data: object, dataSourceId: string })


Parameter

NameTypeDescription
collectionNamestringEither collectionName or dataSourceId. Collection name
dataobjectGeo data
dataSourceIdstringEither collectionName or dataSourceId. Data source ID

Response

[
  {
    "id": string
  },
  // ...
]

getAdmin

The method getAdmin() is used to get the current admin.

Example

this.getAdmin({ adminId: string })


Parameter

NameTypeDescription
adminIdstringStella Admin ID

Response

{
  "appId": string
  "adminId": string
  "externalId": string
}

getAdminByExternalId

The method getAdminByExternalId() is used to get the current admin by its member external ID.

Example

this.getAdminByExternalId({ externalId: string })


Parameter

NameTypeDescription
externalIdstringMember ID in its specific channel. Facebook Page scope ID. WhatsApp Country code and phone number. Slack User ID. WeChat WeChat member ID Teamwork Teamwork member ID Webchat Webchat member ID

Response

{
  "appId": string
  "adminId": string
  "externalId": string
}

getAssignment

The method getAssignment() is used to get the current assignment.

Example

this.getAssignment({ assignmentId: string })


Parameter

NameTypeDescription
assignmentIdstringAssignment ID

Response

{
  "_id": string
  "_version": number
  "app": string
  "assignedAt": timestamp
  "assignee": string
  "createdAt": timestamp
  "etag": string
  "expiry": number
  "group": string
  "groupInfo": object
  "history": boolean
  "isZendesk": boolean
  "inlet": string
  "inletGroupInfo": object
  "member": string
  "meta": object
  "relayMessage": object
  "targets": array<object>
  "updatedAt": timestamp
}

getAssignmentByOutlet

The method getAssignmentByOutlet() is used to get the current assignment by the outlet ID. Please note that the meta object is indeed as MongoDB filter operator. Please see MongoDB for further reference.

Example

this.getAssignmentByOutlet({ channelId: string })


Parameter

NameTypeDescription
channelIdstringOutlet channel ID

Response

{
  "_id": string
  "_version": number
  "app": string
  "assignedAt": timestamp
  "assignee": string
  "createdAt": timestamp
  "etag": string
  "expiry": number
  "group": string
  "groupInfo": object
  "history": boolean
  "isZendesk": boolean
  "inlet": string
  "inletGroupInfo": object
  "member": string
  "meta": object
  "relayMessage": object
  "targets": array<object>
  "updatedAt": timestamp
}

getAssignmentByWhatsappGroupId

The method getAssignmentByWhatsappGroupId() is used to get the current assignment by the WhatsApp group ID.

Example

this.getAssignmentByWhatsappGroupId({ whatsappGroupId: string })


Parameter

NameTypeDescription
whatsappGroupIdstringWhatsApp group ID

Response

{
  "_id": string
  "_version": number
  "app": string
  "assignedAt": timestamp
  "assignee": string
  "createdAt": timestamp
  "etag": string
  "expiry": number
  "group": string
  "groupInfo": object
  "history": boolean
  "isZendesk": boolean
  "inlet": string
  "inletGroupInfo": object
  "member": string
  "meta": object
  "relayMessage": object
  "targets": array<object>
  "updatedAt": timestamp
},

getAssignmentsByMemberId

The method getAssignmentsByMeta() is used to get the current assignment by Stella member ID.

Example

this.getAssignmentsByMemberId({ memberId: string })


Parameter

NameTypeDescription
memberIdstringStella Member ID

Response

[
  {
    "_id": string
    "_version": number
    "app": string
    "assignedAt": timestamp
    "assignee": string
    "createdAt": timestamp
    "etag": string
    "expiry": number
    "group": string
    "groupInfo": object
    "history": boolean
    "isZendesk": boolean
    "inlet": string
    "inletGroupInfo": object
    "member": string
    "meta": object
    "relayMessage": object
    "targets": array<object>
    "updatedAt": timestamp
  }
  // ...
]

getAssignmentsByMeta

The method getAssignmentsByMeta() is used to get the current assignment by providing the meta object.

Example

this.getAssignmentsByMeta({ meta: object })


Parameter

NameTypeDescription
metaobjectData that matches the get request

Response

[
  {
    "_id": string
    "_version": number
    "app": string
    "assignedAt": timestamp
    "assignee": string
    "createdAt": timestamp
    "etag": string
    "expiry": number
    "group": string
    "groupInfo": object
    "history": boolean
    "isZendesk": boolean
    "inlet": string
    "inletGroupInfo": object
    "member": string
    "meta": object
    "relayMessage": object
    "targets": array<object>
    "updatedAt": timestamp
  },
  // ...
]

getAssignmentsByParentAssignmentId

The method getAssignmentsByParentAssignmentId() is used to get the current assignment by the assignment ID of its parent.

Example

this.getAssignmentsByParentAssignmentId({ assignmentId: string })


Parameter

NameTypeDescription
assignmentIdstringParent assignment ID

Response

[
  {
    "_id": string
    "_version": number
    "app": string
    "assignedAt": timestamp
    "assignee": string
    "createdAt": timestamp
    "etag": string
    "expiry": number
    "group": string
    "groupInfo": object
    "history": boolean
    "isZendesk": boolean
    "inlet": string
    "inletGroupInfo": object
    "member": string
    "meta": object
    "relayMessage": object
    "targets": array<object>
    "updatedAt": timestamp
  },
  // ...
]

getChannel

The method getChannel() is used to get the information about the present channel.

Example

this.getChannel({ channelId: string })


Parameter

NameTypeDescription
channelIdstringThe channel ID that you have

Response

{
  "channelId": string
  "appId": string
}

getGroup

The method getGroup() is used to get the information about the present group.

Example

this.getGroup({ groupId: string })


Parameter

NameTypeDescription
groupIdstringGroup ID

Response

{
  "_id": string
  "createdAt": timestamp
  "inlet": string
  "outlet": string
  "name": string
  "meta": object
  "valid": boolean
  "externalId": string
  "botId": string
  "type": string
  "adminExternalId": string
  "app": string
  "assignment": string
  "member": string
  "admin": string
  "_version": number
}

getGroupByExternalId

The method getGroupByExternalId() is used to get the information about the present group.

Example

this.getGroupByExternalId({ adminExternalId: string, groupId: string, type: string, channelId: "string })


Parameter

NameTypeDescription
adminExternalIdstringMember ID in its specific channel. Facebook Page scope ID. WhatsApp Country code and phone number. Slack User ID. WeChat WeChat member ID Teamwork Teamwork member ID Webchat Webchat member ID
groupIdstringGroup ID
channelIdstringChannel ID
typestringOptional Channel type

Response

{
  "_id": string
  "createdAt": timestamp
  "inlet": string
  "outlet": string
  "name": string
  "meta": object
  "valid": boolean
  "externalId": string
  "botId": string
  "type": string
  "adminExternalId": string
  "app": string
  "assignment": string
  "member": string
  "admin": string
  "_version": number
}

getGroupByGroupExternalId

The method getGroupByGroupExternalId() is used to get the information about the present group.

Example

this.getGroupByGroupExternalId({ groupExternalId: string })


Parameter

NameTypeDescription
groupExternalIdstringGroup ID in its specific channel

Response

{
  "_id": string
  "createdAt": timestamp
  "inlet": string
  "outlet": string
  "name": string
  "meta": object
  "valid": boolean
  "externalId": string
  "botId": string
  "type": string
  "adminExternalId": string
  "app": string
  "assignment": string
  "member": string
  "admin": string
  "_version": number
}

getGroupByInletGroup

The method getGroupByInletGroup() is used to get the information about the present group.

Example

this.getGroupByInletGroup({ inletGroupExternalId: string, inlet: string })


Parameter

NameTypeDescription
inletstringInlet ID
inletGroupExternalIdstringInlet group ID in its specific channel

Response

{
  "_id": string
  "createdAt": timestamp
  "inlet": string
  "outlet": string
  "name": string
  "meta": object
  "valid": boolean
  "externalId": string
  "botId": string
  "type": string
  "adminExternalId": string
  "app": string
  "assignment": string
  "member": string
  "admin": string
  "_version": number
}

getGroupByInletGroup

The method getGroupByInletGroup() is used to get the information about the present group.

Example

this.getGroupByInletGroup({ inletGroupExternalId: string, inlet: string })


Parameter

NameTypeDescription
inletstringInlet ID
inletGroupExternalIdstringInlet group ID in its specific channel

Response

{
  "_id": string
  "createdAt": timestamp
  "inlet": string
  "outlet": string
  "name": string
  "meta": object
  "valid": boolean
  "externalId": string
  "botId": string
  "type": string
  "adminExternalId": string
  "app": string
  "assignment": string
  "member": string
  "admin": string
  "_version": number
}

getGroupByMemberId

The method getGroupByMemberId() is used to get the information about the present group.

Example

this.getGroupByMemberId({ inlet: string, memberId: string })


Parameter

NameTypeDescription
inletstringStella Inlet ID
memberIdstringStella Member ID

Response

{
  "_id": string
  "createdAt": timestamp
  "inlet": string
  "outlet": string
  "name": string
  "meta": object
  "valid": boolean
  "externalId": string
  "botId": string
  "type": string
  "adminExternalId": string
  "app": string
  "assignment": string
  "member": string
  "admin": string
  "_version": number
}

getMember

The method getMember() is used to get the information about the present member from its Stella member ID.

Example

this.getMember({ memberId: string })


Parameter

NameTypeDescription
memberIdstringStella Member ID

Response

{
  "_id": string
  "_version": number
  "app": string
  "botId": string
  "botMeta": object
  "channel": string
  "createdAt": timestamp
  "etag": string
  "externalId": string
  "firstName": string
  "gender": string
  "meta": object
  "platform": string
  "profile": object
  "tags": array<object>
  "updatedAt": timestamp
}

handleAdminJoinedGroup

The method handleAdminJoinedGroup() is used to 1. create group in database, 2. deactivate the group invitation and 3. renew the group invitation link after the admin has joined the WhatsApp group.

Example

this.handleAdminJoinedGroup({ channel: object, externalId: string, whatsappGroupId: string, isRenewGroupInviteLink: boolean })


Parameter

NameTypeDescription
channelobjectChannel collection object
externalIdstringMember ID in its specific channel
isRenewGroupInviteLinkbooleanDefault true. Renew the group invitation link
whatsappGroupIdWhatsApp Group ID

Response

string // URL of the group invitation link

inactivateGroup

The method inactivateGroup() can be used to inactivate live chat group.

Example

this.inactivateGroup({ groupId: string })


Parameter

NameTypeDescription
groupIdstringLive chat group ID

Response

{
  "_id": string
  "email": object
  "createdAt": timestamp
  "apps": array<object>
  "acls": array<string>
  "_version": number
} // the updated group object

inletEndLiveChat

The method inactivateGroup() can be used to end the live chat from the inlet. Please note that the these is a default falsy option recallRelayMessage. If recallRelayMessage is truthy, it will recall the ticket sent to outlet channel's ticketing group, currently support slack and teamwork

Example

this.inletEndLiveChat({ channel: object, member: object, options: object })


Parameter

NameTypeDescription
channelobjectChannel object
memberobjectMember object
optionsobjectRequest option

Response

{
  "_id": string
  "email": object
  "createdAt": timestamp
  "apps": array<object>
  "acls": array<string>
  "_version": number
} // the updated group object

patchDataToDataSource

The method patchDataToDataSource() can be used to patch data to data source. In this call, the patch object will be formatted in this way in the data source table: each object becomes a new row; object key becomes column and object value becomes the value.

Example

this.patchDataToDataSource({ collectionName: string, dataSourceId: string, filter: object, patch: object, options: object, multi: boolean, withModifier: boolean })


Parameter

NameTypeDescription
collectionNamestringEither collectionName or dataSourceId. Collection Name
dataSourceIdstringEither collectionName or dataSourceId. Data Soruce ID
filterobjectOptional Filter criteria. Shares the same method as MongoDB query. Please see MongoDB for further reference
multibooleanOptional Whether update multiple fields
optionsobjectOptions for the request
patchobjectThe field and data that needs to be patched
withModifierbooleanDefault false Status the method contains modifier

Response

{
  "matched": number
  "modified": number
  "inserted": number
  "deleted": number
}

patchMembers

The method patchMembers() can be used to patch data to members.

Example

this.patchMembers({ channel: object, memberId: string, filter: object, patch: object, withModifier: boolean })


Parameter

NameTypeDescription
channelobjectChannel object
filterobjectOptional Filter criteria. Shares the same method as MongoDB query. Please see MongoDB for further reference
memberIdstringStella Member ID
patchobjectThe field and data that needs to be patched
withModifierbooleanDefault false Status the method contains modifier

Response

{  
  "result": {
    "_id": string
    "createdAt": timestamp
    "updatedAt": timestamp
    "profile": object
    // ...
  }
}

reassignAssignment

The method reassignAssignment() can be used to reassign the assignment within or in other channels. Only available to WhatsApp, Slack and Teamwork.

Example

this.reassignAssignment({ channel: object, groupName: string, label: string, liveChat: boolean, inletGroup: boolean, meta: object, messageEvent: object, previousAssignment: object, relayMessage: string, summary: string, takenMessage: string, targets: array<object> })


ParameterTypeDescription
channelobjectChannel object
groupNamestringGroup name shown in the outlet group. WhatsApp WhatsApp group name. Slack Channel name. Teamwork Teamwork group name.
labelstringBroadcast group label
liveChatbooleanDefault true Whether it is a live chat
inletGroupbooleanDefault false Whether it is a inlet group condition.
metaobjectData that needs to be updated
messageEventobjectMessage Event object. Please see Message Event documentation for further reference.
previousAssignmentobjectPrevious assignment object
relayMessagestringPreviewed message in the outlet channel
summarystringSummary of the assignment which sends to the ticket taker
takenMessagestringSlack only Message shown after taking the ticket
targetsarrayA list of broadcast group object

Response

Promise<{ member: object, assignmentId: string }>

removePendingAssignmentByMemberId

The method removePendingAssignmentByMemberId() can be used to remove the pending assignment according to the member ID.

Example

this.removePendingAssignmentByMemberId({ memberId: string })


ParameterTypeDescription
memberIdstringStella Member ID

Response

{
  "clientMutationId": string
}

saveGroupIdToMember

The method saveGroupIdToMember() can be used to save the Facebook post comment analytics.

Example

this.saveGroupIdToMember({ channel: object, messageEvent: object })


ParameterTypeDescription
channelobjectChannel object
messageEventobjectMessage Event object. Please see Message Event documentation for further reference.

Response

{
  "clientMutationId": string
}

savePostCommentAnalytics

The method savePostCommentAnalytics() can be used to save the Facebook post comment analytics.

Example

this.savePostCommentAnalytics({ comment: string, channelId: string, fbId: string, isMatched: boolean, memberId: string, name: string, postId: string })


ParameterTypeDescription
commentstringContent of the comment
channelIdstringChannel ID
fbIdstringUnique user ID for users who comment on post
isMatchedbooleanDefault false. Set to true if it's the correct comment trigger; set to false if it's the wrong comment trigger.
memberIdstringStella Member ID
namestringUser name
postIdstringFacebook post ID

Response

{
  "clientMutationId": string
}

sendEmail

The method sendEmail() can be used to send email through Amazon SES service from no-reply@sanuker.com. This method returns nothing from our API.

Example

const params = {
  Destination: {
    CcAddresses: ["sample@sanuker.com", "sample2@sanuker.com"],
    ToAddresses: ["sameple3@sanuker.com", "sameple4@sanuker.com"]
  },
  Message: {
    Body: {
      Html: {
        Charset: "UTF-8",
        Data: "HTML_FORMAT_BODY"
      },
      Text: {
        Charset: "UTF-8",
        Data: "TEXT_FORMAT_BODY"
      }
    },
    Subject: {
      Charset: 'UTF-8',
      Data: 'Test email'
    }
  }
}

this.sendEmail(params)


ParameterTypeDescription
destinationobjectThe email address you want to send and CC to.
messageobjectThe subject and message(in either HTML or Text format) you want to have in the email.

sendFbResponse

The method sendFbResponse() can send Facebook response.

Example

this.sendFbResponse({ channel: object, channelId: string, member: object, memberId: string, response: object })


ParameterTypeDescription
channelobjectChannel object
channelIdstringChannel ID
memberobjectMember object
memberIdstringStella Member ID
responseobjectMessage Event object. Please see Message Event documentation for further reference.

Response

{
  "result": object
  "messageEvent": object
}

sendFbResponseToMemberIds

The method sendFbResponseToMemberIds() can send Facebook response to several members.

Example

this.sendFbResponseToMemberIds({ channel: object, channelId: string, memberId: string, response: object })


ParameterTypeDescription
channelobjectChannel object
channelIdstringChannel ID
memberIdarrayA set of Stella member IDs
responseobjectMessage Event object. Please see Message Event documentation for further reference.

Response

[
  {
    "result": object
    "messageEvent": object
  },
  // ...
]

sendMessageToInlet

The method sendMessageToInlet() can send responses to the member in inlet channel.

Example

this.sendMessageToInlet({ channel: object, messageEvent: object, response: object })


ParameterTypeDescription
channelobjectChannel object
messageEventobjectMessage Event object. Please see Message Event documentation for further reference.
responseobjectResponse object. The structure of the response object can be referred to the Message Event documentation for further reference.

Response

// Facebook
{
  "result": object
  "messageEvent": object
}

// WhatsApp
{
  "result": object
  "messageEvent": object
}

// Slack
{
  "ok": boolean
  "channel": string
  "ts": timestamp
  "message": object
}

// Teams
{
  "result": object
  "messageEvent": object
}

// Webchat
{
  "result": object
  "messageEvent": object
}

// WeChat
{
  "msgType": string
  "url: string
  "image": object
  "text": object
  "video": object
  "title": string
  "description": string
  "news" string
}

sendMessageToInletGroup

The method sendMessageToInletGroup() can send responses to the inlet channel's group. This method is only available for Teamwork and WhatsApp.

Example

this.sendMessageToInlet({ group: object, groupId: string, response: object })


ParameterTypeDescription
groupobjectGroup object
groupIdobjectGroup ID
responseobjectResponse object. The structure of the response object can be referred to the Message Event documentation for further reference.

Response

// WhatsApp
{
  "result": object
  "messageEvent": object
}

// Teamwork
{
  "result": object
  "messageEvent": object
}

sendMessageToOutletGroup

The method sendMessageToInletGroup() can send responses to the outlet channel's group. This method is only available for Teamwork, WhatsApp and Slack.

Example

this.sendMessageToInlet({ group: object, groupId: string, response: object })


ParameterTypeDescription
groupobjectGroup object
groupIdobjectInlet group ID
responseobjectResponse object. The structure of the response object can be referred to the Message Event documentation for further reference.
responseUrlstringSlack onlyResponse URL is used in an interactive components. This allow the components to make a POST request and publish the message back to place where interaction happened. Please see [SlacK] https://api.slack.com/interactivity/handling documentation about App Interactivity for further reference.

Response

// WhatsApp
{
  "result": object
  "messageEvent": object
}

// Slack
{
  "ok": boolean
  "channel": string
  "ts": timestamp
  "message": object
}

// Teamwork
{
  "result": object
  "messageEvent": object
}

sendResponse

The method sendResponse() can send response in different channels.

Example

this.sendResponse({ channel: object, channelId: string, memberId: string, response: object })


ParameterTypeDescription
channelobjectChannel object
channelIdstringChannel ID
memberobjectMember object
memberIdarrayA set of Stella member IDs
responseobjectResponse object. The structure of the response object can be referred to the Message Event documentation for further reference.
messagingTypestringFacebook only Messaging type
messagingTagstringFacebook only Messaging tag

Response

// Facebook
{
  "result": object
  "messageEvent": object
}

// WhatsApp
{
  "result": object
  "messageEvent": object
}

// Slack
{
  "ok": boolean
  "channel": string
  "ts": timestamp
  "message": object
}

// Teams
{
  "result": object
  "messageEvent": object
}

// Webchat
{
  "result": object
  "messageEvent": object
}

// WeChat
{
  "msgType": string
  "url: string
  "image": object
  "text": object
  "video": object
  "title": string
  "description": string
  "news" string
}

sendTeamsResponse

The method sendTeamsResponse() can send response in Teams.

Example

this.sendTeamsResponse({ channel: object, response: object, recipientId: string, receiverType: string, teamsGroupId: string })


ParameterTypeDescription
channelobjectChannel object
responseobjectResponse object. The structure of the response object can be referred to the Message Event documentation for further reference.
recipientIdstringRecipient ID
receiverTypestringRecipient type
teamsGroupIdstringTeams group ID

Response

{
  "result": object
  "messageEvent": object
}

sendTeamworkResponse

The method sendTeamworkResponse() can send response in Teamwork.

Example

this.sendTeamworkResponse({ channel: object, channelId: string, member: object, memberId: string, response: object })


ParameterTypeDescription
ParameterTypeDescription
---------
channelobjectChannel object
channelIdstringChannel ID
memberobjectMember object
memberIdarrayA set of Stella member IDs
responseobjectMessage Event object. Please see Message Event documentation for further reference.

Response

{
  "id": string
  "STATUS": string
}

setWhatsappGroupIcon

The method setWhatsappGroupIcon() can set the set the WhatsApp group icon. Usually used in a live chat conversation.

Example

this.setWhatsappGroupIcon({ channelId: string, imageUrl: string, whatsappGroupId: string })


ParameterTypeDescription
channelIdstringChannel ID
imageUrlstringImage URL
whatsappGroupIdstringWhatsApp group ID

Response

{
  "200": "ok"
}

slackArchiveConversation

The method slackArchiveConversation() can archive Slack's conversation. Usually used in ending a live chat conversation.

Example

this.slackArchiveConversation({ channel: object, messageEvent: object })


ParameterTypeDescription
channelobjectChannel object
messageEventobjectMessage Event object. Please see Message Event documentation for further reference.

Response

{
  "ok": boolean
}

stripe

The method stripe() can help get the stripe object from npm package stripe-node. Please see the stripe-node documentation for further reference. This method returns nothing from our API.

Example

this.stripe({ stripeName: "sample-stripe" })


ParameterTypeDescription
stripeNamestringYour Stripe ID

updateAgenda

The method updateAgenda() can update the agenda in the database.

Example

this.updateAgenda({ memberId: string, meta: object, nextRunAt: number, nodeCompositeId: string, priority: number, pattern: string, replace: boolean, runUntil: number, tag: string, treeId: string })


ParameterTypeDescription
memberIdstringStella Member ID
metaobjectThe data wish to send inside the agenda
nodeCompositeIdstringNode Composite ID
nextRunAtnumberTime for running the next agenda in milliseconds. This property will override the pattern property
patternstringCRON Pattern of the agenda. If you wish to check the CRON pattern, you can use Crontab Guru
prioritynumberThe priority of the agenda
runUntilnumberTimestamp for running the agenda until it stops
replacebooleanDefault false. Whether the input is replaced
treeIdstringTree ID
tagstringMember tag

Response

{
  "_docsIds": {
    "updated": array<string>
  },
  "_docs": array<object>
  "modified": number
}

updateAssignmentGroup

The method updateAssignmentGroup() can update the assignment's group information in the database.

Example

this.updateAssignmentGroup({ assignmentId: string, group: object, whatsappGroupId: string })


ParameterTypeDescription
assignmentIdstringAssignment ID
groupobjectGroup object
whatsappGroupIdstirngWhatsApp group ID

Response

{
  "_docsIds": {
    "updated": array<string>
  },
  "_docs": array<object>
  "modified": number
}

updateAssignmentMeta

The method updateAssignmentMeta() can update the assignment meta in the database.

Example

this.updateAssignmentMeta({ assignmentId: string, meta: object })


ParameterTypeDescription
assignmentIdstringAssignment ID
metaobjectData that needs to be updated

Response

{
  "_docsIds": {
    "updated": array<string>
  },
  "_docs": array<object>
  "modified": number
}

updateGroup

The method updateGroup() can update the group data in the database.

Example

this.updateGroup({ group: object })


ParameterTypeDescription
groupobjectUpdated group object

Response

{
  "_docsIds": {
    "updated": array<string>
  },
  "_docs": array<object>
  "modified": number
}

updateGroupMeta

The method updateGroupMeta() can update the group's meta data in the database.

Example

this.updateGroupMeta({ groupId: string, meta: object })


ParameterTypeDescription
metaobjectData that needs to be updated

Response

{
  "_docsIds": {
    "updated": array<string>
  },
  "_docs": array<object>
  "modified": number
}

updateMember

The method updateMember() can the member's information in the database.

Example

this.updateMember({ member: object })


ParameterTypeDescription
memberobjectMember object

Response

{
  "_docsIds": {
    "updated": array<string>
  },
  "_docs": object
  "modified": number
}

updateMessage

The method updateMessage() can archive Slack's conversation. Usually used in ending a live chat conversation.

Example

this.updateMessage({ attachments: array<object>, channel: object, externalChannelId: string, messageEvent: object, text: string })


ParameterTypeDescription
attachmentsarrayAttachments to be updated
externalChannelIdExternal channel ID
channelobjectChannel object
messageTsstringMessage timestamp
textstringText to be updated

Response

{
  "ok": boolean
  "channel": string
  "ts": timestamp
  "text": "Updated text you carefully authored"
}

uploadFileToS3

The method uploadFileToS3() can upload file to our S3 server. Please note that this method return nothing.

Example

this.stripe({ url: string, options: object, channel: object, filename: string, contentType: string })


ParameterTypeDescription
urlstringURL of the file
optionsobjectOption of the request
channelstringChannel Object
filenamestringName of the file
contentTypestringContent type of the file

WeChatSaveMemberTag

The method WeChatSaveMemberTag() can save member tag in WeChat. Please note that a maximum of 20 tags can be set for a user under an WeChat Official Account.

Example

this.WeChatSaveMemberTag({ member: object, channel: object, tagId: number })


ParameterTypeDescription
channelobjectChannel collection object
memberobjectMember collection object
tagIdnumberTag ID

Response

{
  "errcode": number
  "errmsg": string
}
← GroupRadiate.js →
  • 3rd party library methods
  • Custom methods provided by Stella
    • DB Notes
    • findAndModifyMember (Updated)
    • findAndModifyDataFromDataSource (Updated)
    • upsertDataToDataSource (Updated)
    • newAgenda (Updated)
    • redirectMemberToNode (Updated)
    • createAssignment (Updated)
    • addNewTargetsToAssignment
    • checkAndSaveMemberReferFrom
    • countDataSource
    • createTeamsChannel
    • createWhatsappGroup
    • deleteMemberAgenda
    • disableWhatsappGroupInviteLink
    • endLiveChat
    • endWhatsappLiveChat
    • fbCreateBroadcast
    • fbGetAttachmentId
    • fbPassThreadControl
    • fbRemoveCustomLabel
    • fbSaveCustomLabel
    • fbSendBroadcast
    • fetchDataFromDataSource
    • fetchDistinctDataFromDataSource
    • fetchGeoNearFromDataSource
    • getAdmin
    • getAdminByExternalId
    • getAssignment
    • getAssignmentByOutlet
    • getAssignmentByWhatsappGroupId
    • getAssignmentsByMemberId
    • getAssignmentsByMeta
    • getAssignmentsByParentAssignmentId
    • getChannel
    • getGroup
    • getGroupByExternalId
    • getGroupByGroupExternalId
    • getGroupByInletGroup
    • getGroupByInletGroup
    • getGroupByMemberId
    • getMember
    • handleAdminJoinedGroup
    • inactivateGroup
    • inletEndLiveChat
    • patchDataToDataSource
    • patchMembers
    • reassignAssignment
    • removePendingAssignmentByMemberId
    • saveGroupIdToMember
    • savePostCommentAnalytics
    • sendEmail
    • sendFbResponse
    • sendFbResponseToMemberIds
    • sendMessageToInlet
    • sendMessageToInletGroup
    • sendMessageToOutletGroup
    • sendResponse
    • sendTeamsResponse
    • sendTeamworkResponse
    • setWhatsappGroupIcon
    • slackArchiveConversation
    • stripe
    • updateAgenda
    • updateAssignmentGroup
    • updateAssignmentMeta
    • updateGroup
    • updateGroupMeta
    • updateMember
    • updateMessage
    • uploadFileToS3
    • WeChatSaveMemberTag
Stella Platform Documentation
Docs
Get StartedBot API ReferenceAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2023 Sanuker Inc. Limited