Developers

Conversation

Usage

Use this method to retrieve the Chatbot's answer to a given user query.

Mandatory parameters

Name Type Description
query string The user question to be sent to the Chatbot. It should not exceed 256 characters.

Optional parameters

Name Type Description
options string Parameter to be used only immediately after the Chatbot returns a response that is either a multipleChoiceQuestion or a polarQuestion. It is used to select one of the options presented by the Chatbot.
directCall string Retrieves a response via a Direct Call. If a value is set for this parameter, it will fetch a response via Direct Call, regardless of the other parameter values.

Response data format

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

Example

chatbot.api.conversation("Office hours");