Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
lblancher
Partner - Contributor III
Partner - Contributor III

Create Stream API - Qlik Sense

Hey Everyone,

     Does anyone know if their is an API in Qlik Sense for creating Streams? I see that I can create an app and publish it to an existing stream but their does not seam to be a CreateStream/MakeStream API call. 

I've been using https://help.qlik.com/sense/en-us/developer/#../Subsystems/EngineAPI/Content/WorkingWithAppsAndVisua... for a reference.

Regards,

Lucas

1 Solution

Accepted Solutions
Not applicable

Lucas,

You can use the QRS API to create a stream.  Here is a link to a windows app that contains samples for working with QRS API: Qlik Sense Repository API Windows App.  Below is an example using Postman to demonstrate the minimal set of properties in the json object.

Remember the call to QRS API to create a stream is a POST

Here is a screenshot:

QSPT.png

View solution in original post

10 Replies
Not applicable

Lucas,

You can use the QRS API to create a stream.  Here is a link to a windows app that contains samples for working with QRS API: Qlik Sense Repository API Windows App.  Below is an example using Postman to demonstrate the minimal set of properties in the json object.

Remember the call to QRS API to create a stream is a POST

Here is a screenshot:

QSPT.png

lblancher
Partner - Contributor III
Partner - Contributor III
Author

Thank you Jeffery!  This worked.  One more question, do you know where i can find out more about the Stream API?  I would also like to be able to add/modify the security of the stream if possible.

Regards,

Lucas

Not applicable

Lucas,

You want to review the Qlik Repository API.  The QRS API allows you to set up streams and define the security rules for the streams as well.

Here is the link to the reference documentation: http://help.qlik.com/sense/en-us/developer/#../Subsystems/RepositoryServiceAPI/Content/RepositorySer...

Not applicable

Hi Lucas, I've been trying to do something similar to you, create apps, streams and publish apps all via QRS. I've been able to accomplish eveything except assigning a user to a stream through QRS - did you ever manage to achieve this?

Would you be willing to share your insights? Thanks

Ian

Alexander_Thor
Employee
Employee

Hey Ian,

Hmm that's not how access control is done in QS.
You can check this entry out in the Help around designing access control, https://help.qlik.com/sense/2.0/en-US/online/Subsystems/ManagementConsole/Content/design-access-cont...

Well, in theory you could create one rule per user and per stream but that is highly discouraged as you quickly run into an enormous mess of rules to manage.

This is an example request to create a new rule that apply to a specific stream, this is also a good method to see what gets sent to the QRS API. Just emulate the same action in QMC since it uses the same API

streampost.PNG

Not applicable

Hi Alexander,

thanks for the reply and for your advice, it's very much appreciated.

As you mention linking single users to single streams isn't generally advisable, but in our particular implementation we are having multiple customers accessing one or two apps, we are having individual customers accessing individual apps.

So the design of the solution is driven by need, and your help was great to identify what we were missing (the user to stream mapping)

What was really important and helpful was the tip to use the browser to see what's being posted by QMC and then replicate through QRS. In this case we had the struture correct, but there was a slight syntax error.

What we passed through

{"name":"Security rule for access to stream name","category":"Security","rule":"((user.name="UserName"))","type":"Custom","privileges":["read"],"resourceFilter":"Stream_streamid","actions":2}

What QMC was doing

{"name":"Security rule for access to stream name","category":"Security","rule":"((user.name=\"UserName\"))","type":"Custom","privileges":["create","read","update"],"resourceFilter":"Stream_streamid","actions":2,}

So two things were different here.

We only wanted users to have READ permissions, but even when you set this in QMC, it still sets ["create","read","update"], but it does set the actions value to 2, which appears to be different depending on the permissions you set.

Anyway, we managed to get where we wanted to and your help was a contributing factor, so thanks again.

I hope this is helpful?

I.

Alexander_Thor
Employee
Employee

Hmm, and you have nothing that distinguishes the different customers from each other?
We have done similar setups before but then we either sent in user properties or customer specific user directories to assign app priviliges.

For example, Stream A is accessible for User Directory A. Within stream A users with properties superuser can access app B, everyone can access app C etc.

If you do ticketing it's fairly easy to assign more specific properties to the users as they access the system.

Not applicable

All of our customers have different ID's, and each has 3 apps that are created just for them (all duplicates from a template).

Right now, we've set up streams for each of them to enable the apps to be grouped together, and then used the user to stream association for ease. In the future, we're going to have users that will have access to multiple streams.

All users come from the same directory, so I can't segregate based on directory.

All of the app/stream/user management is triggered by a user sign-up process, where users will use our service for anything from a month to a rolling subscription.

The multi stream to user relationship is likely to be managed more manually as this will be less frequent.

At the end of the subscription, we will have code that automatically un-publishes the apps, deletes the streams etc.

I'm sure as we really learn to use Qlik, we'll find better, more efficient ways to do things. We've only been using it for 3 weeks, and we're still learning, but learning quickly

Thanks for your input though, it's good to stop and think about the approach.

Ian.

Alexander_Thor
Employee
Employee

Sounds good, just drop us a note and we are happy to share some ideas in the future!