Try it!

If after reading the documentation you want to try the Subscription API, 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. Get triggers for a Knowledge Model

Imagine you want to retrieve all the triggers 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 /triggers to the URL.

Get the triggers for a knowledge model

5. Creating a new subscription

Once you know the id of the trigger you want to use to create a subscription, you can create a new subscription just adding the trigger id abc-123-bad-123 to the previous URL. Ensure also the URL is requesting a new subscription appending subscriptions to the end of the URI.

Do not forget to give a name to the subscription, and a valid callback URI, and the system will return to you the id for that new subscription.

Creating a new subscription

6. Get the list of subscriptions

Once you created the subscription, you can get all the subscriptions in the system, it is useful for example to check the status of your subscriptions, just in case any of them is failing, or it is paused or suspended.

Also, the id of the subscription is something important to know, since that information is required for updating, pausing, resuming, unsubscribing and the manual fetching of the data.

Get all the subscriptions

7. Update a subscription

If you have the id of a subscription, you can perform an update to change its name or its callback URI. Just ensure you append the id abc-123-bad-123 to the subscriptions URI, and define a valid name and a valid callback URI.

Updating a subscription

8. Pause a subscription

If you have the id of a subscription, you can pause it to stop receiving events. Just ensure you append the id abc-123-bad-123 to the subscriptions URI, and also append to the command pause at the end

Pausing a subscription

9. Resume a subscription

If you have the id of a paused subscription, you can resume it to start receiving events. Just ensure you append the id abc-123-bad-123 to the subscriptions URI, and also append to the command resume at the end

Resuming a subscription

10. Unsubscribe

If you have the id of a paused subscription, you can unsubscribe it to remove the subscription from the system. Just ensure you append the id abc-123-bad-123 to the subscriptions URI.

Unsubscribe

11. Get events manually

In case of having a failing subscription, is possible to still receiving events but manually.

Just ensure you have the id abc-123-bad-123 of the failing subscription, include the events path to the URI, and finally also append the next-page-from-parking-lot command to the subscriptions URI.

Get events manually

Keep in mind that this is just a simple demo. Features like Filter, Filter Expressions and many others are not supported. However, we expect you now have a better understanding of how to use Intelligence API. If you want to become more familiar with the API, we recommend you to have a look at our Tutorials.