Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Highlighted
satyagopu
New Contributor II

How to create stream using QRS API?

Hello,

How to create stream using QRS api? what is the syntax / API url for create stream ?

Even Documentation is also fine for me

Tags (3)
1 Solution

Accepted Solutions
Employee
Employee

Re: How to create stream using QRS API?

It looks like the "name" property is the only property you really have to define in the body of that call. I've added this example that illustrates how to do it:

https://github.com/kolsrud/qlik_rest_sdk/blob/master/Qlik.Sense.RestClient/Examples/CreateStream/Pro...

5 Replies
Employee
Employee

Re: How to create stream using QRS API?

Partner
Partner

Re: How to create stream using QRS API?

Hello Satyanarayana Gopu,

Here's the code for creating the stream using QRS Api -

Code:

var fs = require('fs');

var request = require('request');

var r = request.defaults({

rejectUnauthorized: false,

host: 'Host-name',

pfx: fs.readFileSync("client.pfx"),

passphrase: '1234' //if you have password to certificate else no need to define this

});

//Authenticate whatever user you want

var b = JSON.stringify({

"UserDirectory": 'user-directory',

"UserId": 'user-Id',

"Attributes": []

});

console.log('New Stream');

r.post({

url:'https://Host-name:4242/qrs/stream/?xrfkey=abcdefghijklmnop',

body: { name: 'user-Id' },

headers: {

'cache-control': 'no-cache',

'x-qlik-user': 'UserDirectory= user-directory; UserId= user-Id',

'content-type': 'application/json',

'x-qlik-xrfkey': 'abcdefghijklmnop'

},

json: true

},function(err,res,body){

console.log(body);

//Check the Stream gets created in Qliksense hub/qmc

}

);

Here's the link for more refernces -

https://help.qlik.com/en-US/sense-developer/September2018/Subsystems/RepositoryServiceAPI/Content/Se...

Link for list of endpoints for QRS Api

https://help.qlik.com/en-US/sense-developer/September2018/Subsystems/RepositoryServiceAPI/Content/Se...

Thanks & Regards,

Prashant Naik

satyagopu
New Contributor II

Re: How to create stream using QRS API?

Thank you Kolsrud.

I will check the documentation. If you have any sample on the create stream using NTLM authentication, please share to me. Thanks!

Employee
Employee

Re: How to create stream using QRS API?

It looks like the "name" property is the only property you really have to define in the body of that call. I've added this example that illustrates how to do it:

https://github.com/kolsrud/qlik_rest_sdk/blob/master/Qlik.Sense.RestClient/Examples/CreateStream/Pro...

satyagopu
New Contributor II

Re: How to create stream using QRS API?

Thanks Kolsrud.

Solution is working fine.

I have added the xrfkey in case of streams due to that it is not working for me.