Preview an agent query chart image

After agent-use authorization, read a query chart image from current-workspace runtime files.

GET https://api.moi.matrixorigin.cn/v5/workspaces/{id}/agents/{agent_id}/query-visuals/{file_id}/preview

Before you call this API

BASE_URL uses the product API prefix https://api.moi.matrixorigin.cn/v5. For a dedicated deployment, use its corresponding product API address.

Prepare same-environment product credentials MOI_KEY and WORKSPACE_ID; BASE_URL includes the product prefix. Obtain all IDs from actual query results. Example data demonstrates structure only.

Request parameters

curl --fail-with-body -sS "$BASE_URL/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/query-visuals/$FILE_ID/preview" \
  -H "X-API-Key: $MOI_KEY" -H "X-Workspace-ID: $WORKSPACE_ID" \
  -o "$OUTPUT_FILE"

Fields

Type

Required

Description

id

string

Yes

Consumer workspace ID.

agent_id

string

Yes

Agent ID for this use authorization.

file_id

string

Yes

Runtime image file ID returned by query.

agent_workspace_id

string

No

Query parameter taking precedence over X-Agent-Workspace-ID. Defaults to consumer workspace.

Agent workspace is limited to the current consumer workspace or system. After rechecking agent.use, the service reads consumer-workspace files, not the agent-definition workspace. Content must be recognized as image/. Success includes no-store, no-referrer, and nosniff. There is no browser-preview conversion or public-link capability.

Successful response

HTTP/1.1 200 OK
<binary file content>

Field/response item

Type

Description

Content-Type

string

Detected from actual image content.

响应体

bytes (byte stream)

Original image bytes.

Success has no common code/data envelope. Temporary files and image streams return bytes directly.

Error response

{
  "jsonrpc": "2.0",
  "id": null,
  "error": {
    "code": -32005,
    "message": "示例本地化错误",
    "data": {
      "reason": "ADMISSION_DENIED"
    }
  }
}

HTTP

code/shape

Condition

400

JSON-RPC or no body

Invalid path/target scope or file ID.

403

JSON-RPC -32005

Agent-use authorization failed.

404

No body

File read failed or content empty.

415

No body

Content not recognized as an image.

503

No body

Handler dependencies unavailable.

Outer identity/task-proof rejection may occur before this handler. Retain raw HTTP, machine codes, and actual diagnostics rather than applying another file protocol’s errors.

Last updated on