Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
LDR
Creator II
Creator II

Qlik Sense on Windows - API - How to get apps list and data load script?

Hi Qlikers,

First at all I have to apologyze if I'm asking something too easy, at this moment it isn't for me. I'm trying to learn from zero how to use QS APIs and everything is new for me.

My goal is to create an external script in order to obtain a list of apps from my QS environment and for each one, I want to get the content that you can see via Data Load Editor, the reason is because I want to know the different data sources that any app is using (QVDs, Excel files, tables from any database, etc.).

I was able to do something similar developing a Qlik app but now I want to obtain this data via API. My first tests were using PowerShell. Let me show you my example:

$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN; UserId=USER1")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$url = "https://QSHOST:4242/qrs/about?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Get -Headers $hdrs -Certificate $cert

It worked for me returning the output below:

LDR_0-1666333638541.png

 

The next step is to obtain the list of apps so I think that I need to change the method-type to POST, I mean something like that:

$body = '{
"UserDirectory": "DOMAIN",
"UserId": "USER1",
"Attributes": [
{
"name": "GETAPPLIST",
"handle": "-1",
"method": "GetDocList",
"params": []
}
]
}'
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=USER1")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$url = "https://QSHOST:4242/qrs/about?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Post -Body $body -ContentType 'application/json' -Headers $hdrs -Certificate $cert

In this case the result I'm obtaining is the next below:

LDR_2-1666333959229.png

So, my questions are:

- Is it possible to do what I want via PowerShell? Can you show me any example? else what developing language you recommend me?

Thanks for your time 😉

 

 

Labels (2)
13 Replies
LDR
Creator II
Creator II
Author

Hi @Øystein_Kolsrud 

I'm thinking that my fail was to think that any API service for Qlik could be queried by any solution and so far I have understood:

  • For topics related to QMC we can use QRS REST API. With this option we can't open an app and extract its script. With this option we can use tools like curl, Postman, etc. because websockets aren't necessary. Saying it in a different way: with QMC I can obtain a list of apps but I can't open each one and see its objects, etc.
  • For topics related to apps we can use QPS API. Then we can open an app and extract its script, lineage, etc.. Whit this option we can't use curl, Postman, ... because we need to be able to create websockets. Then JS, .NET, ... are the options we have to use.

Please, can you confirm me if I'm right.

Thanks for your support

Øystein_Kolsrud
Employee
Employee

I'd say your first bullet is correct, but the second one is rather inaccurate. First of all, QPS typically refers to the Qlik Proxy Service (QRS refers to Qlik Repository Service). Both QRS and QPS APIs are based on REST:

Websockets on the other hand, are required to interact with the Engine API:

The use of websockets is not really tied to a particular technology, and in theory you should be able to use it from any language you want, but this API is somewhat more complicated than simply using REST, so having a library for interacting with it that takes care of the low level stuff highly simplifies things.

Mostly when working with APIs for the client managed version of Qlik Sense you will be interacting with the Repository API and/or the Engine API. The Repository API focuses on App environment like streams, owners, publish status etc, while the Engine API focuses on app contents like script, visualizations and bookmarks.

There is some overlap between the two (you can for instance change the title of an app from the QMC), but in general that is the distinction between the two.

LDR
Creator II
Creator II
Author

Hi @Øystein_Kolsrud 

Ok, thanks for making it more clear. So the summary could be if I want to work with the app content (script, lineage, ...) I have to play with the Engine API.

Knowing that I'm going to improve my knowledge of JS and to try to play with Engine API and Enigma.js.

Thanks a lot 

NadiaB
Support
Support

Hi @LDR 

As @Øystein_Kolsrud  Engine API is the way to go, good thing is that code in .net C# can be used in PowerShell if you try to use/convert code from c#. 

Just wanted to provide the URL for QRS API as I noticed the method you are attempting to use doesn't have a body, probably you were looking for the app/full endpoint https://help.qlik.com/en-US/sense-developer/August2022/APIs/RepositoryServiceAPI/index.html

The documentation to our Engine API is found here:

https://help.qlik.com/en-US/sense-developer/May2022/Subsystems/EngineAPI/Content/Sense_EngineAPI/int...

Hope it helps!

 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm