1.1.6 • Published 8 years ago
qlik-request v1.1.6
qlik-request
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
qreq.generateXrfKey(size, chars) ⇒ string
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);
qreq.request(options, params) ⇒ Promise
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);
});