Query task file¶
Lists the file-level processing results of an import task, filtered by file status.
GET $CLOUDSIGMA_API_BASE/task/files?task_id=$TASK_ID
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare personal access token, target workspace ID and task ID that can access the target workspace.
Query parameters¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, and $TASK_ID with actual values.
Reading files in pages
curl "$CLOUDSIGMA_API_BASE/task/files?task_id=$TASK_ID&page=1&page_size=20" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Filter failed files
Status code 3 indicates a failed file. Repeated status Multiple statuses can be selected.
curl "$CLOUDSIGMA_API_BASE/task/files?task_id=$TASK_ID&status=3" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Read next page
Add page to 1 until the cumulative number of files read reaches data.total, or the next page data.files is empty.
curl "$CLOUDSIGMA_API_BASE/task/files?task_id=$TASK_ID&page=2&page_size=20" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Reading files in pages
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Import task ID. |
|
integer |
No |
Page number. Page 1 is used when omitted or less than 1. |
|
integer |
No |
Number of items per page. Use 20 when omitted or less than 1. |
|
integer (integer array) |
No |
File status. |
Successful response¶
data.total is the total number of files filtered in the current status; data.total_sum is the total number of files in this task.
{
"code": "OK",
"msg": "OK",
"data": {
"files": [
{
"id": "file_01",
"name": "orders.csv",
"type": 1,
"status": 3,
"size": 1024,
"reason": "parse failed",
"path": "orders/orders.csv"
}
],
"total": 1,
"total_sum": 3,
"total_success": 2,
"total_failed": 1
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
array |
Current page file. |
|
string |
File ID. |
|
string |
File name. |
|
integer |
File type code. |
|
integer |
File status code. |
|
integer |
File size in bytes. |
|
string |
Reason for failure. |
|
string |
Source path. |
|
integer |
The total number of files under the current filter conditions. |
|
integer |
The total number of files in the task. |
|
integer |
Number of successful files. |
|
integer |
Number of failed files. |
Error response¶
{
"code": "ErrServer",
"msg": "server error",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Readable error message. |
|
null |
The error response is |