Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ramshad
New Contributor

Connect and Retrieve Data from Qlik Sense Server using Node JS

Hi Community,

I'm a rookie to Qlik Sense. Here I'm trying to retrieve app and object data from Qlik Sense server using node js.

I have tried instructions in Qlik help

https://help.qlik.com/en-US/sense-developer/3.1/Subsystems/RepositoryServiceAPI/Content/RepositorySe...

 

var https = require('https');
var fs = require('fs');
var options = {
   hostname: 'proxy_host_address',
   rejectUnauthorized: false,
   port: 4242,
   path: '/qrs/app?xrfkey=abcdefghijklmnop',
    method: 'GET',
    headers: {
        'x-qlik-xrfkey': 'abcdefghijklmnop',
        'X-Qlik-User': 'UserDirectory= Internal; UserId= sa_repository '
    },
   key: fs.readFileSync("C:\\server.pem"),
   cert: fs.readFileSync("C:\\client.pem"),
   ca: fs.readFileSync("C:\\ca_cert.pem"),
};

https.get(options, function(res) {
   console.log("Got response: " + res.statusMessage);
   res.on("data", function(chunk) {
      console.log("BODY: " + chunk);  
   });
   }).on('error', function(e) {
      console.log("Got error: " + e.message);
});

This is the code I have used.

Got error: connect ETIMEDOUT proxy_host_address:4242

 

But I'm unable to connect to the server from node back end.

 

Can anyone help me with this by providing some reference.

 

Any help is greatly appreciated.

Thanks in advance.

Ramshad

 

1 Reply
mongolu
Contributor

Re: Connect and Retrieve Data from Qlik Sense Server using Node JS

why those spaces?

 

'UserDirectory= Internal; UserId= sa_repository '