You can use the API to obtain metadata for an import definition for module and list imports using the import ID. This enables you to use mappings on your imports without querying the import file itself.

You can retrieve:

  • Name
  • Type
  • Source
  • Column Count
GET

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

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: 112000000059

curl -X GET \
https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/imports/{importId} \
-H 'authorization: AnaplanAuthToken {anaplan_auth_token}' \
-H 'Content-Type:application/json'

{
   "meta":{
      "schema":"https://api.anaplan.com/2/0/models/75A40874E6B64FA3AE0743278996850F/objects/importMetadata"
   },
   "status":{
      "code":200,
      "message":"Success"
   },
   "importMetadata":{
      "name":"Employees from Employees.txt",
      "type":"FILE",
      "source":{
         "textEncoding":"ISO-8859-1",
         "columnSeparator":"\t",
         "textDelimiter":"\"",
         "headerRow":1,
         "firstDataRow":2,
         "decimalSeparator":".",
         "headerNames":[
            "Name",
            "Sales Region",
            "Parent",
            "Code",
            "Sales Team",
            "Start Date",
            "Leave Date",
            "Salary",
            "Address",
            "Quota",
            "Bonus %",
            "Sales Rep",
            "Staff",
            "Exec"
         ],
         "columnCount":14
      }
   }
}

{
   "meta": {
       "schema": "https://api.chimera.anaplan.com/2/0/models/F54977A16CEB42EA973197C4B8B9E42B/objects/importMetadata"
   },
   "status": {
       "code": 200,
       "message": "Success"
   },
   "importMetadata": {
       "name": "NCL - Import New G/L Account Code from SAP (B/S)",
       "type": "MODEL"
   }
}