Send a message to get response from the bot
Sends a message to the bot and returns the response
Body
This is the message body object
-
The id of the Bot to which this question will be asked
-
The content of the message
-
conversation_id string
Conversation Id provides the bot with additional context of last few messages to answer the question. A new Conversation Id is created when it is not provided.
POST /messages
curl \
-X POST https://api.hansei.app/public/v1/messages \
-H "X-API-KEY: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"value":{"bot_id":"bot_4uPeOYWyQ01C8Epg","content":"How do I download my salary slips?"}}'
Request example
{
"value": {
"bot_id": "bot_4uPeOYWyQ01C8Epg",
"content": "How do I download my salary slips?"
}
}
Request examples
{
"bot_id": "string",
"content": "string",
"conversation_id": "string"
}
Response examples (200)
{
"value": {
"id": "msg_wh28S3JlAosqRigy",
"answer": "To download your salary slips, please visit...",
"conversation_id": "conv_eMB2wHLKzvaxLMDJ",
"created_at": 1697386660315
}
}
Response examples (200)
{
"id": "msg_wh28S3JlAosqRigy",
"answer": "Hello, how can I help you?",
"conversation_id": "conv_uFTwrKcx59i24ZOw",
"created_at": 1697386660315
}
Response examples (400)
{
"code": "string",
"message": "string"
}
Response examples (400)
{
"code": "string",
"message": "string"
}
Response examples (402)
{
"code": "string",
"message": "string"
}
Response examples (402)
{
"code": "string",
"message": "string"
}