retrieveConversation
The 'retrieveConversation' route in the Flexibel API is designed to fetch details and statistics about a specific conversation. This route is particularly useful for analyzing conversations, reviewing chat histories, message ratings, and understanding the time spent during the interaction.
POST https://api.flexibel.ai/v0/retrieveConversation
Request
To retrieve information about a specific conversation using curl:
curl https://api.flexibel.ai/v0/retrieveConversation \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"conversationId": "CONVERSATION_ID"
}'
Response
The response includes detailed statistics and history of the specified conversation:
{
"conversationId": "CONVERSATION_ID",
"conversationHistory": [
{
"role": "user",
"content": "User's message",
"timestamp": "2023-01-01T12:00:00Z"
},
{
"role": "ai",
"content": "Chatbot's response",
"timestamp": "2023-01-01T12:01:00Z"
}
// More conversation entries...
],
"messageRatings": [
{
"messageId": "MESSAGE_ID",
"rating": 4
}
// More message ratings...
],
"conversationTime": "Duration in minutes or a timestamp range"
}
Request Body
The table below outlines the parameters for the 'retrieveConversation' route:
Parameter | Type | Required | Description |
---|---|---|---|
conversationId | string | yes | The ID of the conversation to be terminated. |
The 'retrieveConversation' route is vital for gaining insights into the interactions facilitated by the chatbot. It allows for an in-depth review of the conversation's flow, quality of responses, and the overall duration, making it a powerful tool for analysis and improvement of the chatbot's performance. For other functionalities related to conversation management, refer to the 'createConversation' and 'endConversation' routes.