English Qlik Sense Developers 3.2

Qlik Engine API

The Qlik Engine API is a WebSocket protocol that uses JSON to pass information between the Qlik Sense engine and the clients. The Qlik Engine API consists of a set of objects representing apps, lists, and so on. These objects are organized in a hierarchical structure. When you send requests to the API, you perform actions on these objects.

The Qlik Engine API can be used for:

  • creating apps and loading data
  • building stories
  • getting system information

Typical situations where you would use the Qlik Engine API include:

  • building a specialized client as a standalone or web application
  • automating repetitive or complicated updates or changes to apps

To work with the Qlik Engine API, you can use any language or tool that supports WebSockets and can parse JSON. JavaScript is a common and obvious choice, because of its built-in JSON support, and because there are a number of libraries available to make it easier to work with WebSockets.

You can also use the Qlik Sense .NET SDK to build a Windows application that interacts with the Qlik Sense engine.

When you send a request to the Qlik Engine API, you are asking the engine to perform an action on a particular JSON object. You must include the object's handle in the request, as shown in the diagram below. If the response returns an object, that object's handle is included in the response.

Exploring the Qlik Engine API

Using the engine API explorer, you can try out the API by sending messages to and getting answers from the engine.

The engine API explorer is accessible at these URLs:

  • http://localhost:4848/dev-hub/engine-api-explorer for Qlik Sense Desktop
  • https://[server]/dev-hub/engine-api-explorer for Qlik Sense Enterprise

Request syntax

The request object follows the JSON-RPC 2.0 specification and has the following members:

 
MemberDescription / ValueMandatory
jsonrpc

Version of JSON-RPC.

Equals 2.0

Yes
id

Identifier established by the initiator of the request.

If this member is not present, the RPC call is assumed to be a notification.

No
methodName of the method.Yes
handle

Target of the method.

The member handle is not part of the JSON-RPC 2.0 specification.

Yes
delta

Boolean. If set to true, the engine returns delta values.

The default value is false.

Examples of use:

The delta member is set to true to get the delta of the layout or the delta of the properties of an object. For more information, see Get the delta of the layout and Get the delta of properties.

No
params

Sets the parameters.

The parameters can be provided by name through an object or by position through an array.

No

For more information on the syntax, see http://www.jsonrpc.org/specification.

Examples of request object

The parameters are provided by name through an object:

{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "DestroyChild",
  "handle": 2,
  "params": {
    "qId": "LB02"
    }
}

The parameters are provided by position through an array:

{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "DestroyChild",
  "handle": 2,
  "params": [
    "LB02"
  ]
}

Response syntax

The response object follows the JSON-RPC 2.0 specification and has the following members:

MemberDescription / ValueMandatory
jsonrpc

Version of JSON-RPC.

Equals 2.0

Yes
idIdentifier. This identifier must be identical to the identifier in the request object.Yes

result or

error

The member result is required on success.

In case of failure, the member error is displayed.

Yes
change

Handles of the objects that have been updated.

No
closedHandles that have been released (following a remove for example).No
For more information on the syntax, see http://www.jsonrpc.org/specification.

Example of response object

A response object could be as follows:

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
      "qReturn": {
      "qType": "GenericObject",
      "qHandle": 5
      }
    },
  "change": [
    5
  ]
}