Query file details¶
Query file details by file ID.
POST https://moi.matrixorigin.cn/newmoi/catalog/file/info
Preparation before calling¶
First query the file list or upload the file] 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 to be queried.
The caller needs read permissions on the root volume to which the file belongs.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/file/info" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"file_id": "'"$FILE_ID"'"
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
File ID. |
Successful response¶
Returns 200 and file information on success. The caller needs read permissions on the root volume to which the file belongs.
{
"code": "OK",
"msg": "OK",
"data": {
"file_id": "file-123",
"file_name": "orders.csv",
"size": "2048"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
File ID. |
|
string |
File name. |
|
string |
File size in bytes, returned as a numeric string. |
Error response¶
{
"code": "ErrNotFound",
"msg": "Object not found",
"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 file information. |
Record the request time and error message and try again; if it continues to fail, contact support. |
Follow-up operations¶
When returning to processed results, Query file products.