Query task details¶
Read the definition and current status of an import task. After creating, pausing, resuming or retrying, use this interface to confirm whether the task has entered the expected state.
GET https://moi.matrixorigin.cn/newmoi/task/get?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 to be queried, passed through theX-Workspace-IDHeader.$TASK_ID: Createdata.task_idin task response.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/task/get?task_id=$TASK_ID" \
-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. |
Successful response¶
Returns 200 on success.
{
"code": "OK",
"msg": "OK",
"data": {
"task": {
"id": "task_01",
"name": "import_orders",
"config_type": 1,
"source_connector_id": "conn_01",
"connector_name": "orders_mysql",
"volume_id": "vol_01",
"status": 2,
"total_rows": 100,
"imported_rows": 100,
"success_file_count": 1,
"failed_file_count": 0,
"latest_rows": {
"read_rows": 100,
"succeeded_rows": 100,
"failed_rows": 0,
"complete": true
},
"error_code": "",
"error_summary": ""
}
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
Task definition and current processing status. See Import task object fields for each field of this object. |
Error response¶
{
"code": "ErrServer",
"msg": "server error",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The task does not exist, cannot be read, or the service failed to query the task. |
Check both HTTP status and |
Follow-up operations¶
Use the task ID Query task files to view file-level results, or Query running records to view previous runs. When there are many failed files, give the id of the failed files to Retry failed files.