Developers

GetVariablesOptions

Usage

Use this method to return information on specific variables. Such information includes the value currently assigned to the variable, the variable scope and, if the type of the variable is 'List' or 'Dynamic List', the possible variable values.

Mandatory parameters

Name Type Description
variableList Array of strings The names of the variables whose information you want to obtain, separated by commas

Optional parameters

Name Type Description
revealValues Boolean Whether or not the method should return variables that are obfuscated. Default value: false

Response data format

This method calls the Chat API’s POST /conversation/variables/options endpoint. This method returns a Promise with the API response data. Please refer to the Responses section of the endpoint on the Chat API Routes page for the response format.

Example

The following example will ask for the type of vehicle and colour:

var variableList = ['vehicle','colour']
chatbot.api.getVariablesOptions(variableList);