Send a message
Send a message to your Chatbot and get an AI generated response
This endpoint allows you to send a message to your Chatbot, if you havenโt started a conversation one will be created, and the conversationId
will be returned.
POST
https://api.userdesk.io/v1/chatbot/<chatbot_id>/message
The fields marked with *
are mandatory
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <your_chatbot_api_key> |
Request Body
Name | Type | Description |
---|---|---|
message* | String | Your message for the Chatbot |
stream | Boolean | Enable streaming response |
conversationId | String | Conversation id |
userName | String | Name of the user |
userEmail | String | Email of the user |
Continue a conversation
If the field conversationId
is set to true
in the request body, the message will be added to the same conversation.
Streaming responses
If the field stream
is set to true
in the request body, the response will be streamed returning partial message deltas.
This allows the implementation of the ChatGPT-like experience, in which the response from the Chatbot is shown progressively. This usually provides a better user experience, as they don't have to wait until the full response is provided.
This is an example of NodeJS code to use the streaming response:
Interested in Userdesk?
Last updated