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.
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”.
Fill the “Origin” text box with “fiddle.jshell.net” (or whatever the address of your site or web application), and select “frame-ancestors” box under directive.
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.
Create a new fiddle and add resources by clicking the plus button in the left pane.
Add these to your fiddle resources. changing the URL to your tenant's address:
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 "mytenant.qlikcloud.com" In order to get a web integration ID, you can add it in the management console as described here:
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.