Use this method to retrieve the Chat app's answer to a given user query.
Name | Type | Description |
---|---|---|
query | string | The user question to be sent to the Chat. It should not exceed 256 characters. |
Name | Type | Description |
---|---|---|
options | string | Parameter to be used only immediately after the Chat app returns a response that is either a multipleChoiceQuestion or a polarQuestion . It is used to select one of the options presented by the Chat app. |
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. |
This method calls the Chat 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 Chat API Routes page for the response format.
chatbot.api.conversation("Office hours");