Frequently Asked Questions (FAQ)
Requests to Intelligence APIs are blocked by the browser CORS policy
When facing this issue, you will find a CORS error like the one below:
Access to XMLHttpRequest from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
This error occurs when the browser is trying to make a request to a different origin (domain) than the one it's hosted
on and the server the request is being sent to is not configured to allow cross-origin requests.
The Access-Control-Allow-Origin
header is used to specify which origins are allowed to access the resource. If this
header is not present, the browser will block the request and the above error message will be displayed.
Unfortunately, for security reasons, we can't add "localhost" to the response 'Access-Control-Allow-Origin' HTTP header, so this issue must be solved from the API consumer side.
In order to solve this problem, we recommend using a REST client instead of a web browser. This would also ease the process of setting the proper HTTP Authorization headers as part of your requests.
Can I retrieve any Knowledge Model item available in the Celonis Platform through Intelligence APIs?
No, you will not be able to retrieve all the Knowledge Model items available in the Celonis Platform. For reference, Intelligence APIs currently support:
How to retrieve Knowledge Model KPIs through the API
There are two ways to retrieve KPIs via Intelligence API:
-
Using the data retrieval endpoint at KM level (
GET intelligence/api/knowledge-models/{km-id}/data
) and thekpis
parameter -
Using the data retrieval endpoint at KM record level (
GET intelligence/api/knowledge-models/{km-id}/records/{record-id}/data
) when one of the record attributes being equal to a KPI and this attribute is selected usingfields
parameter
Is it possible to pull data from several Knowledge Model records with a single Intelligence API call?
Yes, using the data retrieval endpoint at KM level (GET intelligence/api/knowledge-models/{km-id}/data
), one can combine attributes from different records in the fields
parameter (using the notation record-id
.field-id
) along with KPIs in the kpis
parameter
Example:
Call
GET intelligence/api/knowledge-models/ocpm-procurement-starter-kit-store.ocpm-procurement-km/data?fields=O_CELONIS_VENDOR.NAME,O_CELONIS_VENDOR.COUNTRY,O_CELONIS_VENDOR.CITY,O_CELONIS_CONTRACT.ID&options=distinct&kpis=KPI_PO_ITEM_CONTRACT_USAGE_VALUE_RATE
Result:
{
"page": 0,
"pageSize": 20,
"total": 1,
"sort": [],
"content": {
"headers": [
{
"id": "O_CELONIS_VENDOR.NAME",
"name": "Name",
"type": "string",
"format": null,
"unit": null,
"aggregation": false,
"filterable": true,
"sortable": true
},
{
"id": "O_CELONIS_VENDOR.COUNTRY",
"name": "Country",
"type": "string",
"format": null,
"unit": null,
"aggregation": false,
"filterable": true,
"sortable": true
},
{
"id": "O_CELONIS_VENDOR.CITY",
"name": "City",
"type": "string",
"format": null,
"unit": null,
"aggregation": false,
"filterable": true,
"sortable": true
},
{
"id": "O_CELONIS_CONTRACT.ID",
"name": "Id",
"type": "string",
"format": null,
"unit": null,
"aggregation": false,
"filterable": true,
"sortable": true
},
{
"id": "KPI_PO_ITEM_CONTRACT_USAGE_VALUE_RATE",
"name": "Contract Usage rate [%EUR]",
"type": "float",
"format": ",.1%",
"unit": null,
"aggregation": true,
"filterable": false,
"sortable": true
}
],
"data": [
{
"O_CELONIS_VENDOR.COUNTRY": "DE",
"O_CELONIS_CONTRACT.ID": "Contract_8004700114202",
"O_CELONIS_VENDOR.NAME": "ACDA TYRES",
"KPI_PO_ITEM_CONTRACT_USAGE_VALUE_RATE": 1.0,
"O_CELONIS_VENDOR.CITY": "Bremen"
}
]
}
}