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 DELETE verb instead of the GET one.

In the response:

  • currentStep is the task associated with the specified taskID.
  • taskState is the status that import task.
  • progress is a double that is typically 1.0.
  • result is a JSON object that indicates whether a failure dump file was created, the object ID, and whether the task succeeded.
  • taskID is the ID that you specified in the request.

Here is a list of each possible taskState:

StatusDescription
NOT_STARTEDThe task is scheduled to run, but has not started yet.
IN_PROGRESSThe task is currently running.
COMPLETEThe task has finished running whether successful or not.
CANCELLINGThe task is currently being canceled. Cancellation is not yet complete.
CANCELLEDThe task has been canceled and the changes have been rolled back.

If failures occur during the import task:

  • details contains a JSON array that contains debug information
  • If a dump file is available, failureDumpAvailable is true and objectId contains the ID of the dump file. The dump file contains details of the failures that occurred during the import. You can use the objectId to get the dump file.
GET

/workspaces/{workspaceId}/models/{modelId}/imports/{importId}/tasks/{taskId}

ParameterDescription
workspaceId
  • Required
  • Type: string
  • Description: The workspace ID
  • Example: 8a8b8c8d8e8f8g8i
modelId
  • Required
  • Type: string
  • Description: The model ID
  • Example: 75A40874E6B64FA3AE0743278996850F
importId
  • Required
  • Type: number
  • Description: The import ID
  • Example: 112000000007
taskID
  • Required
  • Type: string
  • Description: The task ID
  • Example: 88E90CC3E2B545C99A262284317F92EB

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'

{
  "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
  }
}