Query task file¶
List the files and processing results in an import task. Based on the file status and failure reason, decide whether to retry the failed file.
GET https://moi.matrixorigin.cn/newmoi/task/files?task_id=$TASK_ID
Before you call¶
Prepare the personal access token, target workspace ID, and task 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: The workspace ID of the task to be queried, passed through theX-Workspace-IDHeader.$TASK_ID: Import task ID.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/task/files?task_id=$TASK_ID&page=1&page_size=20" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The import task ID to be queried. |
|
integer |
No |
Page number. The default value is |
|
integer |
No |
Number of items per page. The default value is |
|
integer[] |
No |
Filter by file processing status; can be passed in repeatedly. Status code: |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
Returns 200 on success.
{
"code": "OK",
"msg": "OK",
"data": {
"files": [
{
"id": "file_01",
"name": "orders.csv",
"type": 1,
"status": 2,
"size": 1024,
"update_time": 1735632000,
"reason": "",
"user": "reader",
"start_time": 1735632000,
"end_time": 1735632060,
"path": "/orders.csv"
}
],
"total": 1,
"total_sum": 1,
"total_success": 1,
"total_failed": 0
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object[] |
Current page task file. |
|
string |
File ID. |
|
string |
File name. |
|
integer |
File type code. |
|
integer |
Processing status code. |
|
integer |
File size in bytes. |
|
string |
Additional metadata for the file; an empty string if there is no additional metadata. |
|
string |
Reason for failure. |
|
string |
The user ID associated with the file. |
|
string |
File path. |
|
integer |
Unix timestamp of when processing started. |
|
integer |
The Unix timestamp of the end processing time. |
|
integer |
The Unix timestamp of the last update time. |
|
integer |
The number of files returned by the current query. |
|
integer |
Total number of all files. |
|
integer |
The total number of successful files. |
|
integer |
Total number of failed files. |
Error response¶
{
"code": "ErrServer",
"msg": "server error",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The query parameter is invalid. |
Fix |
|
|
The service failed to query the task file. |
Check both HTTP status and |
Follow-up operations¶
Pass only the id of the failed file to [retry-failed-import-files.md].