Qlik Engine JSON API
The Qlik Engine JSON API is a WebSocket protocol that uses JSON to pass information between the Qlik associative engine and the clients. The Qlik Engine JSON 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 JSON API can be used for:
- creating apps and loading data
- building stories
- getting system information
Typical situations where you would use the Qlik Engine JSON 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 JSON 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 engine.
When you send a request to the Qlik Engine JSON 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 JSON 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:
Member | Description / Value | Mandatory |
---|---|---|
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 |
method | Name 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 |
return_empty | Returns default and empty values. | No |
cont | Non validating call. Is thrown if the object is not in validated state. Can be used with for instance paging. | No |
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:
Member | Description / Value | Mandatory |
---|---|---|
jsonrpc | Version of JSON-RPC. Equals 2.0 | Yes |
id | Identifier. 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 |
closed | Handles that have been released (following a remove for example). | No |
Example of response object
A response object could be as follows:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 5
}
},
"change": [
5
]
}