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 user on this channel.
bot.user.firstName string User’s first name. This field may be null.
bot.user.lastName string User’s last name. This field may be null.
bot.user.timezone string User’s time zone. This field may be null.
bot.user.profilePictureUrl string URL of the user’s profile picture. This field may be null.
bot.user.locale string User's location. This field may be null.
bot.user.lastActive string Timestamp of when the user was last active with your chatbot.
bot.user.subscribed int Whether the user is subscribed to stories.
bot.user.handedOver boolean Whether the user is currently handed over to a third party like a live chat, or another app.
bot.user.inEU boolean Whether the 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 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 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 user.
params.attachments Array <string> Array of URLs for attachments sent by the 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 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 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 user presses a button. Postbacks are triggered only when the 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 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 stories. The default value is false.

This property is always populated.

bot.messaging.​messageId.inbound String

Unique ID of the message sent from the user.

This property is always populated.

bot.messaging.​messageId.outbound String

Unique ID of the message sent to the 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 Facebook for notifications and stories.

Corresponds to the Purpose field in the Notification or Story settings.

bot.messaging.​pushNotificationType String

The notification type sent to Facebook for notifications and stories. 

Corresponds to the Silent Push configuration setting in Notification or Story settings.

Possible values:

  • SILENT_PUSH
  • REGULAR
bot.messaging.​notificationId String Unique ID of the notification sent to the user.
bot.messaging.storyId String Unique ID of the story sent to the user.
bot.messaging.storyName String Name of the story sent to the 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 user response doesn’t match a question.
bot.settings.general.NonTextCatchAll.enabled boolean Whether the chatbot has a separate Catch All 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 user to choose a quick reply.
bot.settings.general.unexpectedResponse​.buttonText string The text the chatbot uses to reprompt the 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 Catch All question.
bot.settings.general.ignoreLongQuestions​.enabled boolean Whether the chatbot ignores user responses over a certain word length.
bot.settings.general.ignoreLongQuestions​.wordLimit int The maximum number of words a 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 users to live agents.
bot.settings.general.handbackPhrases Array <string> The phrases that can trigger a handback from a live agent to the chatbot.
bot.settings.general.handoverNextPassage Passage Locator The passage to use when handing the 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 sending the next message.
bot.settings.general.delayDuration.max int Maximum number of seconds chatbot will delay before sending 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 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

Comments

0 comments

Article is closed for comments.