Agent Response Feedback
Agent Response Feedback
Allows users to provide feedback on Agent-generated responses to help Agent developers optimize performance.
Request Method
POST
Request URL
https://api-${endpoint}.gptbots.ai/v1/message/feedback
Request Authentication
See Overview for authentication details.
Request
Request Example
curl -X POST 'https://api-${endpoint}.gptbots.ai/v1/message/feedback' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
"answer_id": "123456789",
"feedback": "POSITIVE"
}'
curl -X POST 'https://api-${endpoint}.gptbots.ai/v1/message/feedback' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
"answer_id": "123456789",
"feedback": "POSITIVE"
}'
บล็อกโค้ดนี้ในหน้าต่างลอย
Request Headers
Field | Type | Description |
---|---|---|
Authorization | Bearer ${API Key} | Use Authorization: Bearer ${API Key} for authentication. Get API key from API Key page. |
Content-Type | application/json | Data type, set to application/json. |
Request Parameters
Field | Type | Required | Description |
---|---|---|---|
answer_id | string | Yes | Message ID of Agent response. |
feedback | string | Yes | Feedback on Agent response. - POSITIVE: Positive, Like, Thumbs up, Approval - NEGATIVE: Negative, Dislike, Thumbs down, Disapproval - CANCELED: Cancel feedback |
Response
Response Example
{
"affectCount": 0
}
{
"affectCount": 0
}
บล็อกโค้ดนี้ในหน้าต่างลอย
Success Response
Field | Type | Description |
---|---|---|
affectCount | long | The number of successful feedback. It's 1 if succeed. |
Failure Response
Field | Type | Description |
---|---|---|
code | int | Error code. |
message | string | Error details. |
Error Codes
Code | Message |
---|---|
40000 | Invalid parameter |
40127 | Developer authentication failed |
20059 | Agent deleted |