Query data assets in batches¶
Batch query of generated data assets by original file ID; unprocessed files will not appear in the results.
POST https://moi.matrixorigin.cn/newmoi/catalog/data-assets/batch-get
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 theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$FILE_ID: Original file ID.
Empty file IDs in requests are ignored, and duplicate IDs are only processed as the first occurrence.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/data-assets/batch-get" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"raw_file_ids": ["'"$FILE_ID"'"]
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string[] |
Yes |
A list of original file IDs to query. |
[] after a type means an array. For example, string[] is an array of strings.
Successful response¶
Returns 200 on success, items contains only processed file assets.
{
"code": "OK",
"msg": "OK",
"data": {
"items": [
{
"id": 1,
"asset_id": "asset-01",
"name": "orders.csv",
"raw_file_id": "file-01",
"volume_id": 10,
"asset_type": "file"
}
],
"total": 1
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
array |
List of parsed data assets. |
|
integer |
Data asset internal ID. |
|
string |
Data asset identifier. |
|
string |
Data asset name. |
|
string |
ID of the corresponding source file. |
|
integer |
ID of the root volume that contains the file. |
|
string |
Data asset type. |
|
integer |
The number of data assets returned. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The file ID list is empty, exceeds the limit, or contains invalid values. |
Provide a non-empty list of file IDs. |
|
|
The current identity does not have read permission for the root volume that contains the file. |
Use credentials with read permissions. |
|
|
The server failed to query data assets. |
Try again later. |