Session

The session is the data that is stored for a particular user. A session can span multiple conversations.

You can configure how long this data is kept in the data retention settings.

Default session data

The following data is available for all sessions. An easy way to preview this data is through the debugger in the 'test your bot' window.

Read-only session data

{
   "botId":"1457",
   "sessionId":"emulator-f28feb19-9d00-426a-ac65-539d5e1d3a73",
   "version":"DRAFT",
   "channel":"web",
   "user":{
      "firstName":"Guest"
   },
   "preferredLanguage":"en",
   "locale":"en-us",
   "nlp":{
      "expression":"hi",
      "intent":{
         "name":"Greeting",
         "score":1
      },
      "entities":[
         0
      ],
      "intents":[
         {
            "name":"Greeting",
            "score":1
         }
      ],
      "sentiment":{
         "name":"positive",
         "score":0.5183199216644359
   }
   "currentDialogstate":{
      "name":"introduction",
      "id":"25b838ca-0fea-4b97-b91e-31bd8d932cf9",
      "type":"MESSAGE"
   }
   "previousDialogstate":{
      "name":"introduction",
      "id":"25b838ca-0fea-4b97-b91e-31bd8d932cf9",
      "type":"MESSAGE"
   }
}
PropertyValueDescription

botId

string

ID of the bot

sessionID

string

ID of the session

version

string

version of the session

channel

string

channel of the session

user

object

object containing information about the user

preferredLanguage

string

preferred language of the user

locale

string

preferred locale of the user (for example for date formatting)

nlp

object

object containing data about the latest expression, and which intent and entities were detected, with which confidence

nlp.sentiment

object

shows the sentiment analysis score of an expression

currentDialogstate

object

show the name, id and type of the current bot dialog (or block) the user is in

previousDialogstate

object

show the name, id and type of the previous bot dialog (or block) the user was in

User-changeable session data

The builder of the bot can create and save variables to the user session. This data can be created by the bot through a conversation, or retrieved through an API call. Objects, as well as strings and other types of values can be saved to the user session.

Last updated