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 this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
If you need to filter by agent, first obtain the agent ID.
Set the operation-specific values used in the request:
$AGENT_ID: Optional agent filter ID.
Request¶
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"
Path parameters
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
Query parameters
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Filter by agent ID. |
|
string |
No |
The workspace to which the agent belongs. |
|
string |
No |
Filter by task ID. |
|
string |
No |
Filter by message ID. |
|
string |
No |
Only count the specified score. |
Successful response¶
Returns 200 on success. data.total is the total number of feedback that meets the filter conditions, and data.by_rating returns the count by rating.
{
"code": 0,
"data": {
"total": 12,
"by_rating": {
"up": 9,
"down": 3,
"neutral": 0
}
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
integer |
The total number of feedback that meets the filter conditions. |
|
object |
Amount grouped by rating; returned must contain at least |
|
integer |
The number of feedback for the specified rating. |
Error response¶
{
"code": 2,
"message": "反馈筛选条件无效"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid resource ID or rating filter. |
Check path and query parameters. |
|
|
Credentials are missing or invalid. |
Check API Key. |
|
|
Current identity cannot read workspace feedback. |
Use valid credentials, or contact your administrator for authorization. |
|
|
Feedback review service is unavailable. |
Try again later. |
Follow-up operations¶
Use Query feedback to view specific records under statistical conditions.