Query feedback statistics

Count the total number of reviews that the current user can review and the number of ratings.

HTTP
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.

Shell
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

workspace_id

string

Yes

Current workspace ID.

Query parameters

Parameter

Type

Required

Description

agent_workspace_id

string

No

Current workspace or system. When omitted, the agent source is not limited.

agent_id

string

No

Filter by agent ID.

task_id

string

No

Filter by task ID.

message_id

string

No

Filter by message ID.

rating

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

JSON
{
  "code": 0,
  "data": {
    "total": 12,
    "by_rating": {
      "up": 9,
      "down": 3,
      "neutral": 0
    }
  }
}

Field

Type

Description

data.total

integer

The total number of feedback that matches the filter criteria.

data.by_rating

object

Number of groups by rating. The return contains at least up, down, and neutral.

data.by_rating.up

integer

Amount of positive feedback.

data.by_rating.down

integer

The amount of negative feedback.

data.by_rating.neutral

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.

JSON
{
  "code": 2,
  "message": "反馈筛选条件无效"
}

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

Invalid workspace, agent, task or message ID or rating filter. Recommendation: Check the path and query parameters.

401

6(UNAUTHENTICATED)

Credentials are missing or invalid. Recommendation: Check the API Key.

403

5(PERMISSION_DENIED)

The current identity cannot read the workspace feedback. Recommendation: Use authorized credentials, or contact the administrator for authorization.

503

15(UNAVAILABLE)

Feedback review service is unavailable. Suggestion: Try again later.

Last updated on