Look here for general information about the API usage:
https://developer.survalyzer.com/knowledge-base/authentication/
To connect QlikSense you can follow these steps:
Keep in mind that retrieving data using the Survalyzer NG API a is a 2-step process. First a connection is needed for retrieving an access token. Only after having created an access token the actual data connection can be set up.
With Survalyzer NG it is possible to use the cloud version of QlikSense.
Step 1: Retrieving the access token
First we need to add a new connection.

We need to choose “REST”:

We want first to retrieve a token that authorizes us to retrieve data later:
– Swiss data center:
https://authentication.survalyzer-swiss.app/openid/token– EU data center:
https://authentication.survalyzer-eu.app/openid/token
The method for the request needs to be changed to “POST” and the post content may look like this (changed with your credentials):

If you use username and password (user rights):
grant_type=password&client_id=TENANT_api&username=USERNAME&password=PASSWORD&scope=openidIf you use client secret (account admin rights):
grant_type=client_credentials&client_id=TENANT_api&client_secret=CLIENT_SECRET&scope=openidAnd we add this query header:

After these settings are set you can test the connection. If everything was done correctly the following message should be shown:

You can click on “Create” now.
Step 2: Connecting to survey data
Open your app in QlikSense and open the data load editor:

We will now press the button “Select data” in the right sidebar (as shown in the screenshot):

This window should open, we select “root” and copy the token that gets displayed (maybe save it temporary in a small document somewhere):

Then we press “Insert script”. This will add the following script into the container:

We will need this for later, but will ignore it for now.
Next, we will click on “Create new connection” in the top right corner. This opens this window, where we will select “REST” again:

As URL we will define the call we want to do, in our example we call:
https://api.survalyzer-eu.app/publicapi/Interview/v3/ReadInterviewListCompact
Request method is POST, in our example the request contains a survey ID and a language:

{
"surveyId":15,
"language":"en"
}And then we add the same query header as for the authorization call plus an additional header containing the authorization:

The value for “Authorization” is “Bearer [copied token]”. So in other words, right after the word “Bearer” and a space we paste the earlier copied token. (the token needs to be reset every 30 minutes or it gets invalid)
When this is done we will test the connection. If it succeeds, so far everything is correct. We can click on “Create”.
Our Sidebar now contains 2 connections (one for the authorization and one for the data retreival):

Step 3: Setting up automatic authorization
To setup the automatic authorization we will now first add a snippet to the script we added in Step 1 to save the authorization token in a variable:
Let vAccessToken = Peek('access_token',0,'RestConnectorMasterTable');We paste it just before that table gets dropped:

Now we will add the definitions for our survey call. For that we will click the “Select data” button for the second data connection:

We select “root” on the left side and insert the script:

This adds the neccessary script to the system for the data:

Now we search for the following place in the script, which is in the end of the “SQL SELECT”:
FROM JSON (wrap on) "root" PK "__KEY_root";
We will replace this part with:
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION (
HTTPHEADER "Authorization" "Bearer $(vAccessToken)"
);
With this setup in place QlikSense will always get a new token before receiving data from Survalyzer.
The same authorization bearer information would be needed for all calls that would be added to the project.
To load the data you can click on load data:

Of course, you can modify your script as necessary. If you need to use other ways to retrieve data via the API, we encourage you to check the documentation we have prepared.
| Swiss Datacenter | EU Datacenter |
| Public API documentation | Public API documentation |
Please also remember to use the correct base URL for API calls – depending on the data center:
EU: https://api.survalyzer-eu.app/
Swiss: https://api.survalyzer-swiss.app/