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 theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$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 |
|---|---|---|---|
|
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.