/models/{modelID}/importType (POST)
Creates an import job for a given planning model with the factData, masterData, masterFactData or privateFactData import type.
API Request Details
|
URL |
{BaseURL}/models/{modelID}/importType |
|
Request Type |
POST |
|
Content Type |
application/json |
|
Required Header |
|
|
Name |
x-csrf-token |
|
Value |
<token> |
Additional Parameters
-
importType: mandatory parameter to specify the type of import job you want to create.
-
factData: import data to the fact data table (Data Foundation).
-
masterData: import data to all dimensions of the model.
-
masterFactData: import data to all dimensions and to the fact data table.
-
privateFactData: import data to the fact data table with a specified private version.
-
-
Mapping: optional parameter that allows custom column names to reference internal column names on the model.
-
JobSettings: optional parameter to fine-tune how the data is combined with the target model based on matches of dimensions.
Notes
-
For public dimensions, when importing missing values into parent-child hierarchical data configured as mandatory fields using the Data Import Service API, the column is included and the value is empty.
-
For public dimensions, importing empty values into parent-child hierarchical data configured as mandatory fields using the Data Import Service API, replaces existing fields with the root node of the hierarchy.
-
For local dimensions, when importing empty values into parent-child hierarchical data configured as mandatory fields using the Data Import Service API, empty values are automatically replaced with the root node of the hierarchy.
For more information, see SAP Note 3842199
.
Sample Request
You can send multiple body formats via the request:-
Body with mapping property to rename two columns. In the example below, the import method is set to CleanAndReplace on dimensions Version and Bicycle:
{ "Mapping": { "Bicycle": "Bike", "Shop": "Store" }, "JobSettings": { "importMethod": "CleanAndReplace", "dimensionScope": ["Version", "Bicycle"] } } -
No job settings specified. In the example below, the import method will be set to Update by default. Mapping specified to rename two columns:
{ "Mapping": { "Bicycle": "Bike", "Shop": "Store" } } -
No job settings specified. No mapping specified (empty body):
{} -
In the example below, the import method set to Append:
{ "JobSettings": { "importMethod": "Append" } } -
Content-type: text/csv
Version,Date,Bicycle,Shop,QuantitySold,TotalEarnings
Sample Response
201: Created
{
"JobID": "{jobID}",
"JobURL": "{BaseURL}/jobs/{jobID}"
}
Error Responses
|
HTTP Status Code |
Returns |
|---|---|
|
400 |
Bad Request |
|
403 |
Unauthorized |
|
404 |
Not Found |
|
500 |
Unexpected Error |