Making your first API call using the capability API

Qlik's APIs are extremely powerful ways to embed and leverage the Qlik Analytics Engine in your site or web application. In this tutorial, you can learn how to take your first step towards using these APIs.

Set up your CSP policy in Qlik Sense SaaS

The first thing you need to do is modify Qlik's CSP policy. By default, the Content Security Policy (CSP) only allows usage of Qlik Sense Enterprise from your own tenant. In order to enable outside sites to communicate with your tenant, you'll need to edit the "content security policy" in the Qlik Sense SaaS management console. In the left pane, select “Content Security Policy”. Click “Add”.

Management console with Content Security Policy menu item and Add button highlighted

Fill the “Origin” text box with “” (or whatever the address of your site or web application), and select “frame-ancestors” box under directive.

Content Security Policy - Add origin sidepanel

Get Authenticated

Make sure you are signed in to Qlik Sense SaaS when first accessing it. Once the user is signed in, your browser updates the cookie and allows you to stay signed in. This is the simplest way to get authenticated.

Screenshot of sign in page for Qlik Sense SaaS

Import require.js and qlik-style.css

Create a new fiddle and add resources by clicking the plus button in the left pane.

jsfiddle screenshot with add Javascript/CSS URL button highlighted

Add these to your fiddle resources. changing the URL to your tenant's address:


Sample Code

Here is a working sample code on jsfiddle. This code connects to your Qlik Sense Cloud tenant and gets the property information of an app:

To get it working on an app in your Qlik Sense tenant, you'll need to change the base URL, web integration ID and app ID. The base URL should be the address of your Qlik Sense SaaS tenant, something like "" In order to get a web integration ID, you can add it in the management console as described here:

Screenshot from Management console on Integration/Web page where Create new is highlighted

The ID of the application you want to use can be found in the URL when the application is open. For example with this URL:

The app ID is "c13f39a0-417b-41f4-96a6-944e45187704"

Once this is done, you can run the code in JS Fiddle to see some basic information on the application. Now you've successfully made an API call to your Qlik Sense tenant from an external site.

Was this page helpful?