Query feedback statistics

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

GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/feedback/stats

Preparation before calling

Prepare a personal access token and target workspace ID that has access to the target workspace. If you need to filter by agent, first obtain the agent ID.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through X-Workspace-ID Header.

  • $AGENT_ID: Optional agent filter ID.

Request example

curl --get "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/feedback/stats" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --data-urlencode "agent_id=$AGENT_ID"

Path parameters

Parameters

Type

Is it required

Description

workspace_id

string

Yes

The current workspace ID.

Query parameters

Parameters

Type

Is it required

Description

agent_id

string

No

Filter by agent ID.

agent_workspace_id

string

No

The workspace to which the agent belongs.

task_id

string

No

Filter by task ID.

message_id

string

No

Filter by message ID.

rating

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

code

integer

0 on success.

data.total

integer

The total number of feedback that meets the filter conditions.

data.by_rating

object

Amount grouped by rating; returned must contain at least up, down, and neutral.

data.by_rating.<rating>

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

400

2INVALID_ARGUMENT

Invalid resource ID or rating filter.

Check path and query parameters.

401

6UNAUTHENTICATED

Credentials are missing or invalid.

Check API Key.

403

5PERMISSION_DENIED

Current identity cannot read workspace feedback.

Use valid credentials, or contact your administrator for authorization.

503

15UNAVAILABLE

Feedback review service is unavailable.

Try again later.

Follow-up operations

Use Query feedback to view specific records under statistical conditions.

Last updated on