Skip to main content

Connecting to the Qlik Sense web security service API

ON THIS PAGE

Connecting to the Qlik Sense web security service API

Note: Only tenant admins can perform CRUD operations on Control Security Policy (CSP) entries.

The paths for accessing the API endpoints have the following forms :

  • https://{url}/api/v1/csp-origins
  • https://{url}/api/v1/csp-header

where {url} is the public address of the cluster, for example, abc.us.example.com.

Here is an example of a web security service API endpoint:

PUT {url}/api/v1/csp-origins/{Id} (Update a CSP entry)

For a complete list of endpoints, refer to the API reference documentation.

Create a CSP entry

To create a CSP entry using the Qlik Sense API, send an HTTP Post request to the {URL}/api/v1/csp-origins endpoint. The following examples show you how different client programs can be used to create a CSP entry using the Qlik Sense API. CSP entries that are created using the API are added to the HTTP Content-Security-Policy header in responses from the tenant.

Before you send a request, you need to:

  • Know the URL for the Qlik Sense cluster.
  • Have an API key that is required to make authenticated requests to the API.

Retrieve a CSP header

After you have created a CSP header, you can retrieve it to confirm that it contains the required whitelisted origins and directives configured for the tenant.

The following example shows how to retrieve a CSP header using the Qlik Sense API by sending an HTTP Get request to the {URL}/api/v1/csp-header} endpoint.

Before you send a request, you need to:

  • Know the URL for the Qlik Sense cluster.
  • Have an API key that is required to make authenticated requests to the API.

Update a CSP entry

The following example shows how to update a CSP entry using the Qlik Sense API by sending an HTTP Put request to the {URL}/api/v1/csp-origins/{ID} endpoint.

Before you send a request, you need to:

  • Know the URL for the Qlik Sense cluster.
  • Have an API key that is required to make authenticated requests to the API.
  • Know the ID of the CSP entry that you want to update.