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

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
SaturnV
Partner - Contributor III
Partner - Contributor III

Deleting an App with the Qlik Engine API does only work sometimes

Hi all,

I try to delete a Qlik Sense App with the Qlik Engine API. I tested it via the DEV-HUB Engine API Explorer and an own C# application. The outcome is the same.

I do it with the DeleteApp Method. Example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "DeleteApp",
  "handle": -1,
  "params": [
    "842e869e-3844-4899-a3b5-b32d7040aa3e"
  ],
  "outKey": -1
}

 

At first it fails with a 403: Forbidden. Okay after some googling, I found out I need to be owner of this app. For whatever reason like if being Rootadmin is not enough?

So I try a new app where i set me as Owner - And it works!
However, it does not work every time. The next app i tried, I get a Forbidden error again even though I am the owner!?
Okay then if I try it again with the same app with a DeleteApp request, I receive 9002: Delete in Progress Error.
Why? I thought I can't delete it because it is forbidden!?
However the app can't be deleted anymore. Not even from the QMC directly. It just gives me a "Delete Failed".
The Engine API seems to destroy something.
The solution to this problem however is to restart the Qlik Sense Repository Service...
I really don't understand why the Engine API is so inconsitent.

I thought maybe it needs some time to sync with the repository database or something like that. So I set me as owner to 10 test apps and waited one day. I tried to delete them on the next day with an Engine API DeleteApp Reuqest but still it failed with a 403: Forbidden....

So I duplicated one of the 10 apps. And tried to delete it again with an Engine API DeleteApp Reuqest and now it worked! - Why?

I don't get it.

Can someone please explain?

Thanks and regards
Julian

 

Labels (2)
1 Reply
Øystein_Kolsrud
Employee
Employee

I can't explain what you're seeing here, but in general the recommendation is to use the QRS API for app management stuff. This is the endpoint to use:

https://help.qlik.com/en-US/sense-developer/May2024/APIs/RepositoryServiceAPI/index.html?page=1422

Using the library QlikSenseRestClient (https://www.nuget.org/packages/QlikSenseRestClient/) you can do such a delete like this:

var url = "<url>";
var appId = "<appId>";
var restClient = new RestClient(url);
restClient.AsNtlmUserViaProxy();
restClient.Delete($"/qrs/app/{appId}");