Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
Showing results for 
Search instead for 
Did you mean: 

How can I get the ID of a reload task created using the QRS app/reload API?


Turns out it can't be done using the /app/{id}/reload endpoint. It returns a 204 upon (no content) upon success, meaning that the body has, well, no content. 

The solution would be to first create a new reload task using the POST /reloadtask endpoint. Should work just fine, but is also more involved as you need to pass in more info. Not as convenient as the first endpoint thus, but will give the desired result.


I am using QSEoW and using the QRS API to kick off app reloads. 
The post /app/{id}/reload endpoint (docs here) is easy to use, especially when you have an app that you just want to reload, without having to care about reload tasks etc. 

The thing about that endpoint is that when its called, it will behind the scenes (if needed) create a new reload task called "Manually triggered reload of <app name>". If that task already exists it will not be created again.

I.e. the same behaviour that's available in the QMC's app list via the "Reload now" command.

All good so far, the challenge comes when you need to know more about that behind-the-scenes, auto-created reload task. Specifically, what is its ID? If there is a way to get hold of that new task's ID, any other data can be pulled from the APIs. 
But here's the thing: That ID is not returned from the API call, it seems.


Some more details. Let's say we make this API call:




# Reload app
curl -X "POST" "https://<sense-server-url>:4242/qrs/app/70037700-9400-453f-bebc-845f8a543294/reload?Xrfkey=abcdefghijklmnop" \
-H 'x-Qlik-Xrfkey: abcdefghijklmnop' \
-H 'X-Qlik-User: UserDirectory=Internal; UserId=sa_repository'





This will kick off a reload of the app with ID 70037700-9400-453f-bebc-845f8a543294, returning this info to the caller: 




POST /qrs/app/70037700-9400-453f-bebc-845f8a543294/reload?Xrfkey=abcdefghijklmnop HTTP/1.1
x-Qlik-Xrfkey: abcdefghijklmnop
X-Qlik-User: UserDirectory=Internal; UserId=sa_repository
Host: <sense-server-url>:4242
Connection: close
User-Agent: Paw/3.1.10 (Macintosh; OS X/10.15.5) GCDHTTPRequest
Content-Length: 0




No indication about the fact that a new reload task was created for this app. The response body is completely empty.



But looking at what reload tasks exist for this app, we see that a new one has been created (img right), with a task ID of 210832b5-6174-4572-bd19-3e61eda675ef

My question is then: How can I get hold of that ID as part of the app reload?

Is there a solid way of doing this, except first creating a new reload task and then starting that task, instead of using the app/reload endpoint?

IMHO, expected behaviour would be that the call to /app/{id}/reload would return the task ID of the started task in the response body. That's how APIs usually work, including the Qlik Cloud ones (example here). 



Please mark the post as a solution if it provided you with a solution to the topic at hand. Thanks!
Labels (4)
0 Replies