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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
John_Peter
Partner - Contributor II
Partner - Contributor II

Reload Apps with API

Hi,

I have a requirement to reload an app using API.

I tried with following url 

>curl https://xxx.xx.qlikcloud.com/qrs/app/3e324b7c-bcd3-4984-85bd-2ccfc0aa2155/reload -X POST --ssl-no-revoke -H "Authorization: Bearer eyJhbGciOiJFUzM4NCIsImtpZCI6ImQwOThjZDhkLTc2M2UtNDNjZC1iZjdmLWJjOWQxMWU0MmFlMCIsInR5cCI6IkpXVCJ9.eyJzdWJUeXBlIjoidXNlciIsInRlbmFudElkIjoiMG1CTXExSW1qMnBFWHYyUnhpZzdqUlBqM013ajVoVXoiLCJqdGkiOiJkMDk4Y2Q4ZC03NjNlLTQzY2QtYmY3Zi1iYzlkMTFlNDJhZTAiLCJhdWQiOiJxbGlrLmFwaSIsImlzcyI6InFsaWsuYXBpL2FwaS1rZXlzIiwic3ViIjoiNjRkNDRkMmVlZDc5MjhiODlmN2MxYTdkIn0.0pcXKkfBXZR_JOqDvZh_wOOTg46AG1P8fuRmP2GTlaSo2FCmMWNlGRsW6Wdnb-36xXOzVywNbaTaXMJiM1dnb9vsnXI0PmYSAmjIPLKYmDvsxmh8q2i3etiOEbLVgdWh"

 

But it showing 405 Not allowed Error.

Response

<html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx</center>
</body>
</html>

I tried with Postman also ,got the same error.

Could you anyone suggest how to call API with Post method.

Thanks,

John

 

Labels (2)
1 Solution

Accepted Solutions
stefanstoichev123

It should be POST request to https://XXX.eu.qlikcloud.com/api/v1/reloads and the body is a JSON with the app id:  {"appId":"3e324b7c-bcd3-4984-85bd-2ccfc0aa2155"} (and the authorization header ofc)

The response of this request will be returned when Qlik acknowledge your reload request and NOT when the app is reloaded. The response will have the reload id. 

Once you have the reload id then you can start pooling: GET request to https://XXX.eu.qlikcloud.com/api/v1/reloads/<reload-id> This will return the status of the reload with one of the possible options: QUEUED, RELOADING, CANCELING, SUCCEEDED, FAILED, CANCELED, EXCEEDED_LIMIT

The end statuses (aka the app reload is finished) - SUCCEEDED, FAILED,CANCELED,EXCEEDED_LIMIT

Regards!

Stefan

View solution in original post

6 Replies
stefanstoichev123

qlikcloud.com/qrs? Against which edition you are trying to run the API? Qlik SaaS or Windows?

qlikcloud.com - seems like a SaaS url

/qrs - seems like a Windows edition

Regards!

Stefan

agnie_john
Partner - Contributor II
Partner - Contributor II

Hi  

I am using Qlik sense saas..

could you please tell me the correct api url for Qlik saas ?

Thanks ,J

ohn

stefanstoichev123

It should be POST request to https://XXX.eu.qlikcloud.com/api/v1/reloads and the body is a JSON with the app id:  {"appId":"3e324b7c-bcd3-4984-85bd-2ccfc0aa2155"} (and the authorization header ofc)

The response of this request will be returned when Qlik acknowledge your reload request and NOT when the app is reloaded. The response will have the reload id. 

Once you have the reload id then you can start pooling: GET request to https://XXX.eu.qlikcloud.com/api/v1/reloads/<reload-id> This will return the status of the reload with one of the possible options: QUEUED, RELOADING, CANCELING, SUCCEEDED, FAILED, CANCELED, EXCEEDED_LIMIT

The end statuses (aka the app reload is finished) - SUCCEEDED, FAILED,CANCELED,EXCEEDED_LIMIT

Regards!

Stefan

John_Peter
Partner - Contributor II
Partner - Contributor II
Author

Hi Stefan,

Thanks for your reply.Now i am able to reload my app using API.

 

Thanks,

John.

stefanstoichev123

Not a problem John.

Glad that it worked

Regards!

Stefan

SimonDB
Contributor III
Contributor III

Hi.

This is really useful. Is there a way to expand on this to fetch only the last successful reload of an app?

I'm using this string to fetch back all reload times which I can loop through using __FK_next to get the next 100 records etc.

'https://XXX.XX.qlikcloud.com/api/v1/reloads?filter=status%20eq%20%22SUCCEEDED%22&limit=100'

So rather than looping multiple times to ensure I get all apps and then reducing the table using MAX and grouping by the appId, is there a way to only fetch back the last successful reload details for each app?

Many thanks in advance.