import requestsendpoint = "https://api-prod.usefini.com/v2/bot-requests/feedback"answerId = <uuid> # Replace this with the retrieved answer_uuid from /answer endpointfeedbackType = "thumbs_up" # or "thumbs_down"data = {“answerId”: answerId, “feedbackType”: feedbackType}token = "your_api_key_here" # Best stored in secrets managementheaders = {"Authorization": "Bearer " + token}# Make sure your ‘content-type’ header is set to ‘application/json’response = requests.post(endpoint, json=data, headers=headers)print(response.json());
Copy
{ "message": "Added feedback",}
Endpoint Examples
Store feedback
This endpoint allows you to store feedback from answers in the /answer endpoint
POST
/
v2
/
bot-requests
/
feedback
Copy
import requestsendpoint = "https://api-prod.usefini.com/v2/bot-requests/feedback"answerId = <uuid> # Replace this with the retrieved answer_uuid from /answer endpointfeedbackType = "thumbs_up" # or "thumbs_down"data = {“answerId”: answerId, “feedbackType”: feedbackType}token = "your_api_key_here" # Best stored in secrets managementheaders = {"Authorization": "Bearer " + token}# Make sure your ‘content-type’ header is set to ‘application/json’response = requests.post(endpoint, json=data, headers=headers)print(response.json());
import requestsendpoint = "https://api-prod.usefini.com/v2/bot-requests/feedback"answerId = <uuid> # Replace this with the retrieved answer_uuid from /answer endpointfeedbackType = "thumbs_up" # or "thumbs_down"data = {“answerId”: answerId, “feedbackType”: feedbackType}token = "your_api_key_here" # Best stored in secrets managementheaders = {"Authorization": "Bearer " + token}# Make sure your ‘content-type’ header is set to ‘application/json’response = requests.post(endpoint, json=data, headers=headers)print(response.json());