Try it!

If after reading the documentation you want to give Intelligence API a try, we have prepared a demo environment that anyone can access. Authentication is required, but any token that you pass should work, so no need to get a User or Application key in advance.

To show how this environment works, we will use Postman, but you can use any other REST client.

The URL where this API can be located is: https://16abf815-424c-413e-b92d-6c6f8fc633cd.remockly.com/api. Keep in mind that for real production environments, the URL typically ends with /intelligence/api and not /api.

1. Create a new HTTP Request

Let's start this Tutorial by creating a new HTTP Request in Postman (File > New > HTTP Request). Make sure that you have selected a GET operation and paste the URL for the API next to it: https://16abf815-424c-413e-b92d-6c6f8fc633cd.remockly.com/api.

Create a new HTTP Request

2. Configure authentication

Let's say we have our User API Key which is NASDYUmYxMjItNmJJHuNYSdn7FkLThhasdhj89jM2ODVmOio090sadjkdkVnRFV3VVBtZ1jksadb8olJWXMSDHUASDik3UE5j. Go to Postman and use this key for the Authentication header. Click on Authorization and select Bearer Token for the Type. For the token, paste the above key.

Configure authentication

3. Get the list of Knowledge Models

Now we should be ready to start getting some information such as the full list of Knowledge Models. For that, you need to add '/knowledge-models' at the end of the URL. As we can see, there is one Knowledge Model with the id open-purchase-requisition.purchase-requisition-km and named Purchase Requisition KM. As we can tell by the name, this Knowledge Model is giving us information about purchases that happened in the company.

Get list of Knowledge Models

4. Getting details for a specific Knowledge Model

Next, let's see the details for the Purchase Requisition KM Knowledge Model. In order to do that, we need to append the id of the Knowledge Model to the URL we used for the previous step. In the results we can get extra information for this Knowledge Model, for example that is extending another Knowledge Model with id open-purchase-requisition.purchase-requisition-km-base.

Getting details for a specific Knowledge Model

5. Get KPIs for a Knowledge Model

Imagine you want to retrieve all the KPIs within a Knowledge Model. This is possible just adding the Knowledge Model id, for example open-purchase-requisition.purchase-requisition-km-base and later appending /kpis to the URL.

Get the triggers for a knowledge model

6. Get data across any records & KPIs of a Knowledge Model

Finally, it's time to consume the data from different records and KPIs of the Knowledge Model. For this we need to first append /data to the URL we got in step #4. Then, we should also specify the field Ids and the KPI Ids that we want to retrieve. For this last step, add a parameter in the Params tab named fields with the value MATERIALS.ACTIVITY and one with name kpis and the value AVG_EVENTS_PER_CASE,FILTERED_COUNT. The result:

Get the data for the Materials record