rateMessage
The 'rateMessage' route in the Flexibel API is a key feature for capturing user feedback on specific messages within a conversation. This route allows users to rate a message, essentially providing a 'like' (represented by a rating of 1) or 'dislike' (represented by a rating of 0). This feature is crucial for assessing the quality of responses provided by the AI chatbot and for further improving user experience.
POST https://api.flexibel.ai/v0/rateMessage
Request
To rate a message in a conversation using curl:
curl https://api.flexibel.ai/v0/rateMessage \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messageId": "MESSAGE_ID",
"rating": RATING_VALUE
}'
In this request, replace MESSAGE_ID with the ID of the message you want to rate, and RATING_VALUE with either 1 (like) or 0 (dislike).
Response
The response confirms the successful rating of the message:
{
"message": "Message successfully rated.",
"messageId": "MESSAGE_ID",
"rating": RATING_VALUE
}
Request Body
The table below outlines the parameters for the 'rateMessage' route:
Parameter | Type | Required | Description |
---|---|---|---|
messageId | string | yes | The ID of the message to be rated. |
rating | number | yes | The rating for the message: 1 for like, 0 for dislike. |
The 'rateMessage' route is an essential tool for gathering user feedback on individual messages. This feature not only helps in evaluating the performance of the chatbot but also plays a significant role in tailoring and enhancing the overall conversational experience. For managing and reviewing conversations as a whole, refer to routes like 'createConversation', 'retrieveConversation', and 'endConversation'.