Currently I am working on a problem in SAP Analytical Cloud. I am trying to load a dimension with master data via HTTP requests. For this I am using Postman on our test system. We do not want to create an import job manually in the sac.
An OAuth 2.0 API client was created in the SAC. This was used to access the x-csrf-token. Using the token, a job can then be created and loaded on the publicDimension ALM_TEST_SHORTSTRING using the following links. I tried the loading with the JSON as well as with the CSV format. Both worked and the job was loaded.
POST for job creation: https://(tenant)/api/v1/dataimport/publicDimensions/Xxxxxxxxx:ALM_TEST_SHORTSTRING/publicDimensionData
POST for filling the job with data from body: https://(tenant)/api/v1/dataimport/jobs/cc1daaaf-2376-4c55-9cf6-83bec0fbb11c
Body (JSON):
{
"Mapping":{
"ID":"ID",
"Description":"Description"
},
"DefaultValues":{
"ID":"ST_99"
},
"Data":[
{
"ID":"ST_05",
"Description":"Berlin"
}
]
}
Here the mapping and the DefaultValues can be omitted.
Body (CSV):
ID,Description
ST_05,Berlin
The response to loading is the following. Therefore, the job is filled with the record.
{
"totalNumberRowsInCurrentRequest": 1,
"upsertedNumberRows": 1,
"failedNumberRows": 0,
"failedRows": [],
"validateJobURL": "https://tenant/api/v1/dataimport/jobs/cc1daaaf-2376-4c55-9cf6-83bec0fbb11c/validate",
"runJobURL": "https://tenant/api/v1/dataimport/jobs/cc1daaaf-2376-4c55-9cf6-83bec0fbb11c/run",
"totalNumberRowsInJob": "1"
}
Finally, the following error is displayed during "validate" and "run":
{
"error": {
"code": "2069c8ab-2fbc-484f-4e8a-e112f9374ce2",
"message": "Failed during validation for job [2901]"
}
}
The body is empty, authorization and token both work and for the headers nothing more than the x-csrf-token and the default headers from Postman were set.
Why does the validation fail and also the execution of the job? I have been testing and trying here for a long time, but have not come up with a solution.
Many thanks in advance, Albert
Check the Python operator to create the post call section in this blog post. The x-csrf-token header is not enough. You need to forward the received cookies as well. The documentation does not specify that anywhere sadly.
https://blogs.sap.com/2023/06/08/feed-sap-analytics-cloud-model-using-the-new-data-import-service-api-and-sap-data-intelligence-cloud/