Qlik Community

Integration, Extension & APIs

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

cancel
Showing results for 
Search instead for 
Did you mean: 
satyagopu
Contributor II
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

1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

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...

View solution in original post

5 Replies
Øystein_Kolsrud
Employee
Employee

Prashant_Naik
Partner
Partner

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
Contributor II
Contributor II
Author

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!

Øystein_Kolsrud
Employee
Employee

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
Contributor II
Contributor II
Author

Thanks Kolsrud.

Solution is working fine.

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