Retry failed files¶
Retry the failed file specified in the import task. A successful response will not return the running record. Please query the file and running record again to confirm the result.
POST https://moi.matrixorigin.cn/newmoi/task/retry
Before you call¶
Prepare the personal access token, target workspace ID, and task ID that have access to the target workspace. First Query task files, select only failed files; the task must be in completed or failed state.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: The workspace ID to retry the task, passed through theX-Workspace-IDHeader.$TASK_ID: Import task ID.$FILE_ID: ID of the failed file.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/task/retry" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{\"task_id\":\"$TASK_ID\",\"ids\":[\"$FILE_ID\"]}"
Retry all failed files:
curl -X POST "https://moi.matrixorigin.cn/newmoi/task/retry" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{\"task_id\":\"$TASK_ID\"}"
Request body¶
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
yes |
Import task ID. |
|
string[] |
No |
List of failed file IDs to retry; omitting or passing an empty array will retry the task on all failed files. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
Returns 200 on success and data is null. A successful submission does not mean that the file has been processed.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
This interface does not return retry run records. |
Error response¶
{
"code": "ErrForbidden",
"msg": "permission denied",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is invalid, or the task is not in a completed or failed state. |
Fix |
|
|
The caller does not have permission to operate the task. |
Check workspace and object authorization. |
|
|
The service is temporarily unable to complete the authorization check. |
Try again later. |
|
|
Service failed to submit retry. |
Check both HTTP status and |
Follow-up operations¶
After retrying the acceptance, Query task files and Query run records again to confirm whether the number of failed items has been reduced.