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
Method and endpoint
/workspaces/{workspaceId}/models/{modelId}/imports/{importId}
Parameters
| Parameter | Description |
workspaceId |
|
modelId |
|
importId |
|
Curl example
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'
Response
Response 200 (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
}
}
}
Response 200 when Type=MODEL (application/json)
{
"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"
}
}