Batch parsing file products

Batch query the existence of parsing products and their associated identifiers by file ID.

POST https://moi.matrixorigin.cn/newmoi/catalog/file-artifacts:batchResolve

Preparation before calling

First query the file list to obtain the file ID. Prepare a list of personal access tokens, target workspace IDs, and file IDs that have access to the target workspace.

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.

  • $FILE_ID: File ID to parse.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/file-artifacts:batchResolve" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "file_ids": ["'"$FILE_ID"'"]
  }'

Request body

Parameter

Type

Required

Description

file_ids

string[]

Yes

List of file IDs to query.

[] after a type means an array. For example, string[] is an array of strings.

Successful response

When successful, 200 is returned. Each result item describes the corresponding file and product status.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "items": [
      {
        "file_id": "file-01",
        "file_exists": true,
        "has_artifact": true,
        "source_file_id": "file-01",
        "parsed_file_id": "file-02",
        "root_asset_id": "asset-root",
        "parsed_asset_id": "asset-parsed",
        "volume_id": 10
      }
    ]
  }
}

The response fields are as follows.

Field

Type

Description

data.items

array

File product analysis results.

data.items[].file_id

string

Requested file ID.

data.items[].file_exists

boolean

Whether the file exists.

data.items[].has_artifact

boolean

Whether the file has related products.

data.items[].source_file_id

string

Source file ID.

data.items[].parsed_file_id

string

Parsed product file ID.

data.items[].root_asset_id

string

Root data asset ID.

data.items[].parsed_asset_id

string

Parsed data asset ID.

data.items[].volume_id

integer

ID of the root volume to which the file belongs.

Error response

{
  "code": "ErrNotFound",
  "msg": "对象不存在",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

File ID list is empty or invalid.

Provide a non-empty list of file IDs.

403

ErrForbidden

The current identity does not have read permissions on the root volume to which the file belongs.

Use credentials with read permissions.

404

ErrNotFound

The requested file does not exist.

Check file ID.

500

ErrServer

The server failed to parse the file product.

Try again later.

Last updated on