A set of helper functions to query the Qlik Sense REST endpoints
Author: Loïc Formont
License: MIT Licensed
Example
var qreq = require("qlik-request");
- qlik-request
- .generateXrfKey([size], [chars]) ⇒
string
- .request(options, [params]) ⇒
Promise
- .generateXrfKey([size], [chars]) ⇒
Generates a random Xrf key of a given size within a set of given chars
Kind: static method of qlik-request
Returns: string
- the xrf key
Param | Type | Default | Description |
---|---|---|---|
[size] | int |
16 |
the number of characters of the xrf key |
[chars] | string |
"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789" |
the characters from which to construct the key |
Example
var xrf = qreq.generateXrfkey(8);
Makes a request on a Qlik Sense API endpoint defined in the options object, posting the params object
Kind: static method of qlik-request
Returns: Promise
- a promise resolving to the response to the request
Param | Type | Description |
---|---|---|
options | options |
the options to connect to the API endpoint |
[params] | Object |
the parameters to post to the API endpoint |
Example
qreq.request({
restUri: 'https://10.76.224.72:4243/qps/ticket',
pfx: pfx,
passPhrase: ''
}, {
'UserId': 'qlikservice',
'UserDirectory': '2008R2-0',
'Attributes': []
}).then(function(retVal) {
console.log(retVal);
});