Qlik Sense Proxy API
Qlik Sense Proxy is not very popular but its quite important component of QSEoW. All the user traffic is passing through it. Its one of these components that if it doesen't works then nothing works :)
Communicating with Proxy APIs is not this common as the interaction with Repository API or Engine API. But there are cases where we have to be able to communicate with the Proxy (usually in some backend solutions).
The API itself is not this "rich" (compared to the Repository API for example) and it exposes a small number of endpoints (REST).
Two main cases where the Proxy API can be used is to create Qlik session or ticket for specific user.
We've created qlik-proxy-api
Node package that exposes all Proxy endpoints in a sigle package.
Using the package is quite simple:
import fs from "fs";
import https from "https";
import { QlikProxyApi } from "qlik-proxy-api";
const httpsAgentCert = new https.Agent({
rejectUnauthorized: false, // if we want suppress certificate errors (like self-signed certificate error)
cert: fs.readFileSync(`path/to/client.pem`),
key: fs.readFileSync(`path/to/client_key.pem`),
});
// create new instance or qlik-proxy-api
const proxyApi = new QlikProxyApi.client({
host: "my-qs-host",
port: 4243, // optional. default is 4243
httpsAgent: httpsAgentCert,
authentication: {
user_dir: "SOME_USER_DIR",
user_name: "SOME_USER_ID",
},
});
// at this point we can use proxyApi to call any method
const ticketResponse = await proxyApi.ticketAdd({
userId: "SOME_USER_ID",
userDir: "SOME_USER_DIR",
});
console.log(ticketResponse.ticket); // id of the generated ticket
You should also get nice code completion
Code documentation can be found at this page and the code repository here.
Feel free to contact us at info (at) informatiqal (dot) com or @informatiqal if You have any questions.
Have a nice day!
Informatiqal