curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"smart_chat_assistant_id": "65d5f3473d5d68095462165d",
"message": "Who are you?",
"history": [
{
"role": "assistant",
"message": "History message"
},
{
"role": "user",
"message": "Hi"
},
{
"role": "assistant",
"message": "Hello! How can I assist you today?"
}
]
}' \
https://api.quickblox.com/ai/ai_extensions/ai_answer_assist
{
"answer": "Hello! How can I assist you today?"
}
{
"errors": [
"Validation Error: history: Invalid history data, must be an array of objects with keys: role(must be user or assistant) and message(string). For example:\n{\"history\":[{\"role\":\"user\", \"message\":\"Some message\"}]}"
]
}
{
"errors": [
"The resource wasn't found"
]
}
{
"errors": [
"AI Answer Assistant is disabled"
]
}
AI
AI Answer Assist
POST
/
ai
/
ai_extensions
/
ai_answer_assist
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"smart_chat_assistant_id": "65d5f3473d5d68095462165d",
"message": "Who are you?",
"history": [
{
"role": "assistant",
"message": "History message"
},
{
"role": "user",
"message": "Hi"
},
{
"role": "assistant",
"message": "Hello! How can I assist you today?"
}
]
}' \
https://api.quickblox.com/ai/ai_extensions/ai_answer_assist
{
"answer": "Hello! How can I assist you today?"
}
{
"errors": [
"Validation Error: history: Invalid history data, must be an array of objects with keys: role(must be user or assistant) and message(string). For example:\n{\"history\":[{\"role\":\"user\", \"message\":\"Some message\"}]}"
]
}
{
"errors": [
"The resource wasn't found"
]
}
{
"errors": [
"AI Answer Assistant is disabled"
]
}
Before call make sure that AI Answer Assist feature enabled on admin
dashboard, otherwise you will get 405 error.
Body Parameters
Message you want to get answer for. The maximum length for the message is 2000
symbols.
Headers
A user or application session token. See Authentication
page to learn more about session tokens.
Responses
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: eddf864695d72d33b959eec2ae6c640d817dfada" \
-d '{
"smart_chat_assistant_id": "65d5f3473d5d68095462165d",
"message": "Who are you?",
"history": [
{
"role": "assistant",
"message": "History message"
},
{
"role": "user",
"message": "Hi"
},
{
"role": "assistant",
"message": "Hello! How can I assist you today?"
}
]
}' \
https://api.quickblox.com/ai/ai_extensions/ai_answer_assist
{
"answer": "Hello! How can I assist you today?"
}
{
"errors": [
"Validation Error: history: Invalid history data, must be an array of objects with keys: role(must be user or assistant) and message(string). For example:\n{\"history\":[{\"role\":\"user\", \"message\":\"Some message\"}]}"
]
}
{
"errors": [
"The resource wasn't found"
]
}
{
"errors": [
"AI Answer Assistant is disabled"
]
}
Was this page helpful?