Hi, I need to get a list of the apps through an external development. I tried to do it with "Qlik Engine JSON API" using websockets in nodejs:
const WebSocket = require ('ws');
// Set certPath to the path to the directory that contains the exported client certificates in PEM format.
var certPath = path.join ('C:', 'ProgramData', 'Qlik', 'Sense', 'Repository', 'Exported Certificates', '.Local Certificates');
var certificates = {
cert: fs.readFileSync (path.resolve (certPath, 'client.pem')),
key: fs.readFileSync (path.resolve (certPath, 'client_key.pem')),
root: fs.readFileSync (path.resolve (certPath, 'root.pem'))
};
// Open a WebSocket using the engine port (rather than going through the proxy)
// We use the certificates and a built-in Qlik service account
// We connect at the global level, which gives access to APIs in the Global class
const ws = new WebSocket ('wss: //server.domain.com: 4747 / app /', {
ca: certificates.root,
cert: certificates.cert,
key: certificates.key,
headers: {
'X-Qlik-User': 'UserDirectory = internal; UserId = sa_engine '
}
});
ws.onopen = function (event) {
// send some message
}