Query feedback statistics¶
Count the total number of reviews that the current user can review and the number of ratings.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/feedback/stats
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace. If you need to filter by agent, first obtain the agent ID.
Request parameters¶
Replace $WORKSPACE_ID, $CLOUDSIGMA_API_KEY, $AGENT_ID in the example with actual values.
curl --get "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/feedback/stats" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "agent_id=$AGENT_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID. |
Query parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Current workspace or system. When omitted, the agent source is not limited. |
|
string |
No |
Filter by agent ID. |
|
string |
No |
Filter by task ID. |
|
string |
No |
Filter by message ID. |
|
string |
No |
Only the specified ratings are counted. |
agent_workspace_id only allows the current workspace or system, and the source is not limited when omitted. When the old running list lacks the agent source workspace, it will be processed according to the current workspace.
Successful response¶
{
"code": 0,
"data": {
"total": 12,
"by_rating": {
"up": 9,
"down": 3,
"neutral": 0
}
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
The total number of feedback that matches the filter criteria. |
|
object |
Number of groups by rating. The return contains at least up, down, and neutral. |
|
integer |
Amount of positive feedback. |
|
integer |
The amount of negative feedback. |
|
integer |
Amount of neutral feedback. |
Error response¶
Internal error may return HTTP 500, code=1. Handle actual error codes, not just parameter errors and service unavailable errors.
{
"code": 2,
"message": "反馈筛选条件无效"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Invalid workspace, agent, task or message ID or rating filter. Recommendation: Check the path and query parameters. |
|
|
Credentials are missing or invalid. Recommendation: Check the API Key. |
|
|
The current identity cannot read the workspace feedback. Recommendation: Use authorized credentials, or contact the administrator for authorization. |
|
|
Feedback review service is unavailable. Suggestion: Try again later. |