Creating Sense data connections

If you intend to call Butler’s REST API from the load script of Sense apps, you must create a few data connections first. A couple of them are mandatory, one is optional.

Two mandatory data connections must be created: Butler_GET and Butler_POST.

The latter is used both for POST calls and also PUT, DELETE and other HTTP operations.
The X-HTTP-Method-Override HTTP header is used with the Butler_POST data connection to tell Butler which HTTP operation should be used.

This is a way to work around a limitation of Qlik’s REST connector, as it only supports GET and POST operations.

One data connection is optional: URL encode table
It is used to URL encode strings, which is useful when passing strings to Butler’s REST API (or other APIs!).

URL encode table

This is a basic “web file” connector pointing to http://www.w3schools.com/tags/ref_urlencode.asp:

Creating the URL encode table data connection

Butler_GET

With Butler running, create a new REST data connection called “Butler_GET”.
It’s URL should point to Butler’s host/port.

When createing REST data connections it’s always a good idea to verify they work.
Using the /v4/butlerping endpoint is an easy way to do this (assuming that endpoint is enabled in Butler’s config file):

Creating the data connection can look like this:

Creating the Butler_GET data connection Creating the Butler_GET data connection
Creating the Butler_GET data connection Creating the Butler_GET data connection

No special settings are needed - just make sure the REST connector finds Butler as it should.
The actual URL of the data connection will be modified on the fly every time you call the Butler APIs, it’s thus not really important which URL is entered during the setup phase. But the /v4/butlerping endpoint is a conveneint way to check that the data connection works.

Test the connection before creating it:

Testing the Butler_GET data connection

Butler_POST

The data connection used for POST, PUT, DELETE and all other HTTP operations beyond GET should be named “Butler_POST”.
Its configuration is similar to that of Butler_GET, except that a message body is also needed for the POST to work.

Assuming Butler’s key-value store is enabled in the main config file, you can create a dummy key-value pair using a POST command with the following payload.

The effect is that the data connection is created and can be used for future POST/PUT/DELETE operations against Butler’s API.
The fact that is was created against the key-value store doesn’t matter, the data conncetion details will be replaced each time it is used.

{
  "key": "abc",
  "value": "123",
  "ttl": "5000"
}

Creating the data connection can look like this:

Creating the Butler_POST data connection Creating the Butler_POST data connection
Creating the Butler_POST data connection Creating the Butler_POST data connection

… and test the connection before creting it.

Testing the Butler_POST data connection

Last modified 2023-06-13: Update docs to Butler v9.0 (6ae1377)