This API enables you to associate feedback from the Assistant answers.
Check the generic variables needed to use the API.
Feedback API provides the following endpoints:
Method |
Path |
Description |
POST |
/feedback/request/{requestId} |
Add feedback to a request associated with a user's execution; note the requestId parameters are returned on every assistant reply. |
Updates an assistant feedback using the associated request identifier (requestId).
Parameter |
Type |
Description |
origin |
string |
Origin for the feedback, use user-feedback |
answerScore |
number |
Associated feedback: 1 good, 2 bad |
comments |
string |
Associated feedback comment (optional) |
{
"origin": "user-feedback",
"answerScore": 2,
"comments": "this is a wrong anwer!!"
}
The expected response is a 200 statusCode and empty ({}) json
curl --location '$BASE_URL/v1/feedback/request/{requestId}' \
--header 'Content-Type: application/json' \
--header 'X-Saia-Cache-Enabled: false' \
--header 'Authorization: Bearer $SAIA_PROJECT_APITOKEN' \
--data '{
"origin": "user-feedback",
"answerScore": 2,
"comments": "bad answer!"
}'
import requests
import json
url = f"{BASE_URL}/v1/feedback/request/{requestId}"
payload = json.dumps({
"origin": "user-feedback",
"answerScore": 2,
"comments": "bad answer!"
})
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {SAIA_PROJECT_APITOKEN}',
}
response = requests.request("POST", url, headers=headers, data=payload)
Organization API
API Reference