Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
We are working on a project to possibly manage the assignment/removal of license using API calls and event triggered events.
The goal is to address the below cases:
Where can we find documentation or the correct APIs to build such features against our Qlik Sense server.
We have qliksense server running on version: Qlik Sense June 2018 12.26.1
Currently we are checking the following API calls but nothing substantial has been found yet, based on documentation found here.
Any help on this is very appreciated
DELETE /qrs/license/useraccesstype/ID
Example code: https://github.com/levi-turner/QlikSenseScripts/blob/master/qlik_sense_purge_unused_user_access_pass...(uses Qlik CLI)
Adding: POST /qrs/license/useraccesstype
Body (where ID = the ID of the user): {"user": {"id": "447d3ce4-5492-41bb-99c6-460456ae4363"}}
Removing: Same as above
But why I got "(400)Bad Request" when I try to POST /qrs/license/useraccesstype with your method.
the url I am posting to is: https://***.southeastasia.cloudapp.azure.com:4242/qrs/license/useraccesstype?Xrfkey=Dorph1HyqLsZGeKg
And I found most open api end points with GET method working well, such as:
https://***.southeastasia.cloudapp.azure.com:4242/qrs/user?Xrfkey=Dorph1HyqLsZGeKg
@Levi_Turner , I'm trying to de-allocate professional licenses based on the user's id... will this work
{FQDN}:4242/qrs/license/professionalaccesstype/full?Xrfkey=1234567890123456&filter=(user.id eq 'f5806d7d-6758-4422-b803-1b2fd3950fa4')
I tried this but it says
The call for removal would be:
DELETE /qrs/license/professionalaccesstype/6fa395c1-4de6-47bf-96e1-5ca484168a9d
So you get the ID from:
GET /qrs/license/professionalaccesstype/full
do your app logic for group membership then call DELETE with the IDs from the GET
Thank you! @Levi_Turner
Hi @Levi_Turner ,
Endpoint POST /qrs/license/useraccesstype allocate license for single user.
Is there any way if we could allocate multiple users? Help would be much appreciated.
Thanks!
Babita
Option 1: Just loop over them in your code. In PowerShell it'd be something like
$ids = '1','2'
foreach ($id in $ids) {
# Do stuff
}
But similar approaches exist in all scripting or programming languages.
Option 2: Toy with the Selection endpoint (https://help.qlik.com/en-US/sense-developer/APIs/RepositoryServiceAPI/index.html?page=1099) which allows you to do edits to multiple things. It's how the QMC works. I honestly haven't played with this approach at all myself.
Personally, option 1 is easier to deploy, simpler to understand and maintain, and is more conducive to adding robustness checks / logging.
Thank you @Levi_Turner for the quick response.
But, how to call Qlik api endpoint from powershell? Also, the id which we pass in loop, is that GUID or Name?
Thanks!
Babita
hi guys,
I managed to create a script that assign tokens getting users from csv file. The tokens are correctly assigned and binded to the users in QMC but opening an app I still get the No Access Pass error. Any idea?
thanks in advance,
best,