Use this endpoint to get the status of an ongoing import task.
This lets the integration determine whether the import is pending, running, completed, completed with warnings, or failed.
Notes:
- As a best practice, we recommend you check the status of an ongoing import action no more than once every 5 seconds. For long running imports it is suggested to check at even longer intervals.
- You can cancel an ongoing monitoring task if you make the same call using the
DELETEverb instead of theGETone.
In the response:
currentStepis the task associated with the specifiedtaskID.taskStateis the status that import task.progressis a double that is typically 1.0.resultis a JSON object that indicates whether a failure dump file was created, the object ID, and whether the task succeeded.taskIDis the ID that you specified in the request.
Here is a list of each possible taskState:
| Status | Description |
NOT_STARTED | The task is scheduled to run, but has not started yet. |
IN_PROGRESS | The task is currently running. |
COMPLETE | The task has finished running whether successful or not. |
CANCELLING | The task is currently being canceled. Cancellation is not yet complete. |
CANCELLED | The task has been canceled and the changes have been rolled back. |
If failures occur during the import task:
detailscontains a JSON array that contains debug information- If a dump file is available,
failureDumpAvailableis true andobjectIdcontains the ID of the dump file. The dump file contains details of the failures that occurred during the import. You can use theobjectIdto get the dump file.
Method and endpoint
/workspaces/{workspaceId}/models/{modelId}/imports/{importId}/tasks/{taskId}
Parameters
| Parameter | Description |
workspaceId |
|
modelId |
|
importId |
|
taskID |
|
Curl example
curl -X GET \
https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/imports/{importId}/tasks/{taskId} \
-H 'authorization: AnaplanAuthToken {anaplan_auth_token}' \
-H 'Content-Type:application/json'
Response
Response 200 (application/json)
{
"meta": {
"schema": "https://api.anaplan.com/2/0/models/F1111111C11111111B11111F1111E11F/objects/task"
},
"status": {
"code": 200,
"message": "Success"
},
"task": {
"taskId": "1B1D84DDD53847BAA621810B593C3FC1",
"currentStep": "Complete.",
"progress": 1.0,
"result": {
"details": [
{
"localMessageText": "Employees: 90 (0/90) rows successful, 5 ignored ",
"occurrences": 0,
"type": "hierarchyRowsProcessed",
"values": [
"hierarchyName",
"Employees",
"successRowCount",
"90",
"successCreateCount",
"0",
"successUpdateCount",
"90",
"warningsRowCount",
"0",
"warningsCreateCount",
"0",
"warningsUpdateCount",
"0",
"failedCount",
"0",
"ignoredCount",
"5",
"totalRowCount",
"95",
"totalCreateCount",
"0",
"totalUpdateCount",
"90",
"invalidCount",
"0",
"updatedCount",
"90",
"renamedCount",
"90",
"createdCount",
"0"
]
}
],
"failureDumpAvailable": false,
"objectId": "112000000009",
"successful": true
},
"taskState": "COMPLETE",
"creationTime": 1571258347545
}
}