Query file products¶
Query file product information by file ID.
GET https://moi.matrixorigin.cn/newmoi/catalog/file-artifacts/{file_id}
Preparation before calling¶
First query the file list to obtain the target file ID. Prepare the personal access token, target workspace ID, and file ID 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: The file ID of the product to be queried.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/catalog/file-artifacts/$FILE_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Description |
|---|---|---|
|
string |
File ID. |
Successful response¶
Returns 200 and file product information when successful; returns 404 when the file does not exist.
{
"code": "OK",
"msg": "OK",
"data": {
"file_id": "file-123",
"file_exists": true,
"has_artifact": false,
"derivations": [],
"assets_by_id": {}
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
The queried file ID. |
|
boolean |
Whether the file exists. |
|
boolean |
Whether the file has related products. |
|
string |
Source file ID; may be omitted if not available. |
|
string |
Parsed product file ID; can be omitted if not available. |
|
object |
Root data asset; may be omitted if not available. |
|
object |
Data asset in processing; may be omitted if not available. |
|
object |
The parsed data asset; may be omitted if not available. |
|
array |
Data asset derivation relationship. |
|
object |
Mapping metadata between original file and parsed product; may be omitted if not available. |
|
object |
Related assets indexed by asset ID. |
Error response¶
{
"code": "ErrNotFound",
"msg": "对象不存在",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Pass in a valid file ID. |
|
|
The current identity does not have read permission on the root volume to which it belongs. |
Use credentials with read access, or contact your administrator for authorization. |
|
|
File does not exist. |
Check file ID. |
|
|
The service cannot read the file product. |
Record the request time and error message and try again; if it continues to fail, contact support. |
Follow-up operations¶
Save the identification of the target item and then Query Catalog details.