Use this procedure to run an import that uses a mapping parameter. In this example, the import maps data into the Actual item in the Version dimension.

Make sure you have:

  • A valid Anaplan authentication token.
  • The workspace ID.
  • The model ID.
  • The import ID for the import you want to run.
  • Access permissions to run the import in the target model.

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

  1. Create a POST request to the import tasks endpoint.

 curl -X POST \
 -H 'Authorization: AnaplanAuthToken {anaplan_auth_token}' \
 -H 'Content-Type: application/json' \
 -d '{
   "localeName": "en_GB",
   "mappingParameters": [
     {
       "entityType": "Version",
       "entityName": "Actual"
     }
   ]
 }' \
 'https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/imports/{importId}/tasks'

  1. Replace the path parameters with your own values. Parameter Required Type Description Example workspaceId Yes string The workspace ID. 8a8b8c8d8e8f8g8i modelId Yes string The model ID. 75A40874E6B64FA3AE0743278996850F importId Yes number The import ID. 112000000018
  2. In the request body, specify the locale and mapping parameter. The localeName value must appear before the mappingParameters array. The mappingParameters array tells Anaplan which target dimension item to use when running the import. In this example, the import maps data into the Actual item in the Version dimension.

 {
 "localeName": "en_GB",
 "mappingParameters": [
   {
     "entityType": "Version",
     "entityName": "Actual"
   }
 ]
}

  1. Send the request. If the request is successful, Anaplan returns a task ID.

{
 "meta": {
   "schema": "https://api.anaplan.com/2/0/models/75A40874E6B64FA3AE0743278996850F/objects/task"
 },
 "status": {
   "code": 200,
   "message": "Success"
 },
 "task": {
   "taskId": "310296FE3D914C84AC813E7758A085DB"
 }
}

The import task starts. Use the returned taskId to check the status of the import task.