Chatbot properties

The following properties are available within your scripts.

Read-only

All properties listed below are read-only.

Property Type Description
bot.customProperties Object Use this as a repository for custom properties you’d like to use across your chatbot, such as a lookup table of store opening hours. These properties are available across all scripts and users within the chatbot.
bot.settings Object Chatbot settings configured by chatbot designer in the inGenious AI dashboard. See Bot.settings properties.
bot.user.id string Unique ID of the user in the inGenious AI platform.
bot.user.channel string

Name of the channel. Currently-supported channels are:

  • messenger
  • smooch
  • google_assistant
  • khoros
  • teams
  • zendesk
  • genesys_dialogflow.
bot.user.channelUserId string ID identifying the chatbot user on this channel.
bot.user.firstName string Chatbot user’s first name. This field may be null.
bot.user.lastName string Chatbot user’s last name. This field may be null.
bot.user.timezone string Chatbot user’s time zone. This field may be null.
bot.user.profilePictureUrl string URL of the chatbot user’s profile picture. This field may be null.
bot.user.locale string Chatbot user's location. This field may be null.
bot.user.lastActive string Timestamp of when the chatbot user was last active with your chatbot.
bot.user.subscribed int Whether the chatbot user is subscribed to broadcasts.
bot.user.handedOver boolean Whether the chatbot user is currently handed over to a third party like a live chat, or another app.
bot.user.inEU boolean Whether the chatbot user is from the European region.
bot.teamId string The chatbot's team ID.
bot.botId string The chatbot's ID.
bot.version string ID of the currently-published chatbot version.
bot.environment string

The environment the chatbot is operating in:

  • playground: the chatbot is operating in a testing environment such as the Test Bot or Messenger Playground.
  • production: the chatbot is operating in a production channel.
bot.isNewUser boolean Whether this chatbot user is new to the chatbot in this channel.
bot.event Object

Metadata for the user event last received by the chatbot, such as the chatbot user pressing a Quick Reply.

See Bot.event properties 

bot.messaging Object

Metadata for the most recent message sent from the chatbot.

See Bot.messaging properties.

params.text string The last text response sent from the chatbot user.
params.attachments Array <string> Array of URLs for attachments sent by the chatbot user.
params.metadata Object Object to be passed into the sendTextMessage(), sendAttachmentMessage() and sendTemplateMessage() methods. Contains a Passage Locator to tell the chatbot where to go next in the conversation flow, along with other attributes. See Passage Locator.
params.quickReplies Array <Quick Reply> Array of quick replies configured for a message. See Quick Reply

Bot.event properties 

The following properties represent the last user event received by your chatbot.

Read-only

All properties listed below are read-only.

Property Type Description
bot.event.channelUserId String Unique ID of the chatbot user for this channel.
bot.event.teamId String Unique ID of the team.
bot.event.botId String Unique ID of the chatbot.
bot.event.message Object

An object representing the message sent from the chatbot  user, such as a text response, image or quick reply. 

A bot.event will typically contain either a message or a postback.

Example 1
"message": {
  "text": "Please enter the postcode",
  "is_echo": true,
  "metadata": "{\"endPassage\":false,
                \"type\":\"RESPONSE\",
                \"messageIndex\":0,
                \"passageId\":\"AAAAAAA\",
                \"conversationId\":\"BBBBBB\",
                \"chatbot\":true}"
}
Example 2
"message": {
  "attachment": {
    "type": "image",
    "payload": {
      "url": "https://media.au.ingenious.ai/
              default-image.jpg"
    }
  },
  "is_echo": true,
  "metadata": "{\"endPassage\":false,
                \"type\":\"RESPONSE\",
                \"messageIndex\":1,
                \"passageId\":\"AAAAAAA\",
                \"conversationId\":\"BBBBBB\",
                \"chatbot\":true}"
}
Example 3
"message": {
  "attachment": {
    "type": "template",
    "payload": {
      "template_type": "generic",
      "elements": [{
        "title": "Visit Google",
        "subtitle": "Click to visit Google home page",
        "buttons": [{
          "type": "web_url",
          "url": "https://www.google.com",
          "title": "Google"
        }],
        "image_url": "https://www.google.com/
                      images/branding/
                      googlelogo/1x/
                      googlelogo_color_272x92dp.png"
      }, {
        "title": "Visit Facebook",
        "subtitle": "Click to visit Facebook home page",
        "buttons": [{
          "type": "web_url",
          "url": "https://www.facebook.com",
          "title": "Facebook"
        }],
        "image_url": "https://static.xx.fbcdn.net/
                      rsrc.php/y8/r/dF5SId3UHWd.svg"
      }]
    }
  },
  "is_echo": true,
  "metadata": "{\"endPassage\":false,
                \"type\":\"RESPONSE\",
                \"messageIndex\":3,
                \"passageId\":\"AAAAAAA\",
                \"conversationId\":\"BBBBBB\",
                \"chatbot\":true}"
}
Example 4
"message": {
  "text": "Confirm",
  "playgroundMetadata": "{\"disableIntellimem\":true}",
  "quick_reply": {
    "nextPassage": {
      "conversationId": "LLLLLL",
      "passageId": "MMMMM"
    }
  }
}
bot.event.postback Object

An object representing the postback which is triggered when a chatbot user presses a button. Postbacks are triggered only when the chatbot user presses a button, not a Quick Reply.

A bot.event will typically contain either a message or a postback.

Example:

"postback": {
  "nextPassage": {
    "conversationId": "MMMMM",
    "passageId": "PPPPP"
  }
}

Bot.messaging properties

The following properties represent information about the current interaction between the chatbot user and the chatbot. Only properties relevant to the current interaction are populated.

Read-only

All properties listed below are read-only.

Property Type Description
bot.messaging.type String

The type of message received. The default value is RESPONSE.

Other values include:

  • UPDATE
  • MESSAGE_TAG

This property is always populated.

bot.messaging.​noSubsequentNotification boolean

Whether only the first message should be sent in notifications or broadcasts. The default value is false.

This property is always populated.

bot.messaging.​messageId.inbound String

Unique ID of the message sent from the chatbot user.

This property is always populated.

bot.messaging.​messageId.outbound String

Unique ID of the message sent to the chatbot user. This is null if the message has not yet been sent.

This property is always populated.

bot.messaging.messageIndex int

The indice of the current message when sending a multi-message response. 

This is used when responding to Echo messages.

bot.messaging.tag String

The message tag sent to Meta for notifications and broadcasts.

Corresponds to the Purpose field in the notification or broadcast settings.

bot.messaging.​pushNotificationType String

The notification type sent to Meta for notifications and broadcasts. 

Corresponds to the Silent Push configuration setting in notification or broadcast settings.

Possible values:

  • SILENT_PUSH
  • REGULAR
bot.messaging.​notificationId String Unique ID of the notification sent to the chatbot user.
bot.messaging.storyId String Unique ID of the broadcast sent to the chatbot user.
bot.messaging.storyName String Name of the broadcast sent to the chatbot user.

Bot.settings properties

The following properties representing the chatbot’s settings are available within your scripts. More information on these properties can be found in Chatbot settings.

Read-only

All properties listed below are read-only.

Property Type Description
bot.settings.general.defaultTimezone string Chatbot’s default timezone, in the format of “Australia/Melbourne”
bot.settings.general.catchAll Passage Locator Which passage the chatbot uses when the chatbot user response doesn’t match a question.
bot.settings.general.NonTextCatchAll.enabled boolean Whether the chatbot has a separate fallback enabled for attachments such as images.
bot.settings.general.mapTextToButton.enabled boolean Whether the chatbot accepts matching text as a button-press.
bot.settings.general.unexpectedResponse​.maxPrompts int The maximum number of times the chatbot reprompts after an unexpected response.
bot.settings.general.unexpectedResponse​.quickReplyText string The text the chatbot uses to reprompt the chatbot user to choose a quick reply.
bot.settings.general.unexpectedResponse​.buttonText string The text the chatbot uses to reprompt the chatbot user to press a button.
bot.settings.general.intellimem.enabled boolean Whether Intellimem is enabled for the chatbot.
bot.settings.general.intellimem.firstrepeat Passage Locator The passage to use instead of the first repeated response.
bot.settings.general.intellimem.subsequentRepeat Passage Locator The passage to use instead of a repeated response after Intellimem has been triggered.
bot.settings.general.intellimem.expiry int Number of seconds after which to use the original passage again instead of the Intellimem response.
bot.settings.general.intellimem.catchAllOnly boolean Whether Intellimem is enabled only for the default fallback.
bot.settings.general.ignoreLongQuestions​.enabled boolean Whether the chatbot ignores chatbot user responses over a certain word length.
bot.settings.general.ignoreLongQuestions​.wordLimit int The maximum number of words a chatbot user can type before the response is considered a “long question” to be ignored.
bot.settings.general.ignoreLongQuestions​.nextPassage Passage Locator Which passage the chatbot uses in response to a long question.
bot.settings.general.handoverUnexpectedNewUser​.enabled boolean Whether the chatbot hands unexpected new chatbot users to livechat agents.
bot.settings.general.handbackPhrases Array <string> The phrases that can trigger a handback from a livechat agent to the chatbot.
bot.settings.general.handoverNextPassage Passage Locator The passage to use when handing the chatbot user back to the chatbot.
bot.settings.general.handoverExpiryTime int Number of hours before a chatbot handover expires.
bot.settings.general.typingIndicator.enabled boolean Whether the chatbot displays a typing indicating during message delays.
bot.settings.general.delayDuration.min int Minimum number of milliseconds chatbot will delay before starting the next message.
bot.settings.general.delayDuration.max int Maximum number of seconds chatbot will delay before starting the next message.
bot.settings.general.delayDuration.perWord int Number of milliseconds chatbot will delay a message for each word in the message.
bot.settings.general.questionDataRetention integer Number of days chatbot user data is retained for review.
bot.settings.general.deactivateBot.​activeConversationId string The ID of the starting conversation when the chatbot is active.
bot.settings.general.deactivateBot.​inactiveConversationId string The ID of the starting conversation when the chatbot is inactive.
bot.settings.general.debugCommands.enabled boolean Whether debugging commands are enabled in the production environment.

 

Was this article helpful?
0 out of 0 found this helpful