Sending feedback
POST /api/v1/ai/feedback
Initially, when an answer is rated, you should set the value of the feedback property within the chata-data history object. This value can be set to either negative or positive. Following this, proceed to call this endpoint to store the feedback. The endpoint will respond with a generated reply in the appropriate language of the conversation.
As a subsequent step, you can present this message to the user and request their email address. If you intend to forward this conversation to the configured support email address, you can simply make another call to this endpoint, setting the sendEmail property to true and including the user’s email address within the email property. Once more, this endpoint will provide a generated response that you can display to the user.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Your API key from account settings.
Request Body required
Section titled “Request Body required ”object
Use the returned chat-data object from the query to render the answer. Then when an answer received negative feedback (for example using a thumbs-down button), you can set the feedback property to the value negative for that rated answer. You must always supply this chat-data object submitting feedback.
Your account ID. See: https://unless.com/en/dashboard/account/settings
Your API key. See: https://unless.com/en/dashboard/account/settings
The website ID you trained the AI on.
An unique identifier for your visitor.
Can be ‘negative’, ‘positive’, ‘escalated’ or ‘note’.
Responses
Section titled “ Responses ”object
When requireEmail, the UI should prompt the visitor for their email to escalate the conversation.
Example
{ "conversationId": "d35f69a04d7b252b25f0186b2524e517f96704cc78da7e38a29ab8b92be41617", "sender": "bot", "message": "I'm sorry to hear that. If you prefer to communicate with a person, kindly provide your email, and someone from support will get in touch with you.", "type": "requireEmail"}Invalid request parameters.