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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Gauresh
Partner - Contributor II
Partner - Contributor II

Removing Unused Qlik Sense Licenses via QRS API from a Qlik App

@Levi_Turner 

Hi levi,
I am building a Qlik Sense application using the REST Connector. I have already used the Qlik Monitoring Apps and a GET method to identify users who have not logged in to Qlik Sense for the last 90 days.

Now I want to automatically remove the license (token/professional or analyzer access) from those inactive users using the QRS API through the REST Connector.

I am facing difficulty configuring the POST request in the REST Connector to perform this action.

  • Could you explain how to properly create and configure a POST REST API connection in Qlik Sense to remove a user’s license using the QRS API?
Labels (2)
5 Replies
Levi_Turner
Employee
Employee

You're going to struggle as there isn't a POST method API to achieve that goal, only DELETE methods.

Gauresh
Partner - Contributor II
Partner - Contributor II
Author

Just to confirm are you saying that this cannot be achieved through a Qlik app using a REST connection, since the API only supports DELETE methods and there isn’t a POST method available for this operation? Also, is there any workaround or alternative approach to achieve this?”

Levi_Turner
Employee
Employee

The way I'd describe things is:

  1. In order to remove an assignment (named token, professional, delete), you need to use the DELETE method for the request to the API
  2. The Qlik REST Connector supports GET and POST methods

Thus this use case would require a bit more engineering to rig things up successfully. In terms of alternatives, the question really becomes, do you have an established tooling / technique / language for invoking REST APIs? Qlik Sense's use of REST APIs is very standard so there's no need to recommend approaches if the organization already has competency in this area. You will often find references to approaches like https://github.com/ahaydon/Qlik-Cli-Windows since every server running Qlik Sense also has PowerShell installed which makes it a convenient first choice.

Gauresh
Partner - Contributor II
Partner - Contributor II
Author

Hi Levi,

I’m trying to deallocate a license using the Talend tRESTClient component (DELETE method) with the below endpoint:

/jwt/qrs/license/professionalaccesstype/{id}?xrfkey=<16_digit_key>

While extracting user data using the GET method (/qrs/license/professionalaccesstype), I noticed that for a single user I’m getting two different IDs. I tried using both of them in the delete API.

However, I’m facing two different errors:

1️⃣ For one ID:

Body: [{"schemaPath": "License.ProfessionalAccessType"
'"errorText": "Cannot find the item for
the \"Get)" operation."}]
Error Code: 404
[statistics] disconnected

2️⃣ For the other ID:

Body:: No matching endpoint found

Error Code: 404
[statistics] disconnected

I’m a bit confused about which ID should be used for license deallocation and whether I might be hitting the wrong endpoint or method.

Could you please help me understand what might be going wrong here and what I should correct?

Levi_Turner
Employee
Employee

The 404 makes me thing something is wrong at the authentication / authorization layer.

  • Authentication: Make sure you are JWTing as the user you expect.
  • Authorization: Make sure the user has the requisite rights to delete things. RootAdmin will do but you can get more granular.

On my end, this flow works perfectly fine:

GET /qrs/license/professionalaccesstype/full

Example response:
{
	"id": "1485f340-ca57-4b67-a047-6367434bf83e",
	"createdDate": "2025-03-15T02:45:18.713Z",
	"modifiedDate": "2025-03-15T02:45:18.713Z",
	"modifiedByUserName": "INTERNAL\\sa_repository",
	"user": {
		"id": "8c8e5b55-a2be-4041-a946-194916425594",
		"userId": "ABC",
		"userDirectory": "MYDIRECTORY",
		"userDirectoryConnectorName": "MYDIRECTORY",
		"name": "My Name",
		"privileges": null
	},
	"lastUsed": "1753-01-01T00:00:00Z",
	"excess": false,
	"quarantined": false,
	"quarantineEnd": "1753-01-01T00:00:00Z",
	"deletedUserId": "",
	"deletedUserDirectory": "",
	"privileges": null,
	"schemaPath": "License.ProfessionalAccessType"
}

DELETE /qrs/license/professionalaccesstype/1485f340-ca57-4b67-a047-6367434bf83e