Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
richardpearce60
Contributor II
Contributor II

API - Replace an existing published dashboard

Hi Everyone,

I'm importing a new application into a SaaS tenant using Qlik SDK (Post / Put)

qlik.apps.import_app(data=f)
All good! from there, I'm publishing it to a managed space:
published_app = application.publish({"spaceId": "6657348d053e38f4f18fedeb"})
 
All good!
 
Now at some point in the future, I'm going to import a new application into the tenant and want to overwrite the one I've previously published. I can do that in the HUB as it gives you the option when you're about to publish an app with the same name. However, I can't find that in the APIs
 
So if the new app imported is 'ead56dd2-cd4e-460f-a0b3-61e5b81b6aa4'
and the existing app already published is '90276b41-02fb-4a19-b2c0-0c25d3c0da37'
 
I've tried:
republished_app = application.set_publish({"targetId": "90276b41-02fb-4a19-b2c0-0c25d3c0da37"})
 also tried
published_app = application.publish({"spaceId": "6657348d053e38f4f18fedeb","originAppId":"90276b41-02fb-4a19-b2c0-0c25d3c0da37","moveApp": True})
 
Tried a few other combinations but nothing has worked. I always seem to get an error or a new dashboard. It's important not to create a new application as I want to keep the URLs constant
 
 
Any help would be appreciated!
 
 
 
 
 
Labels (2)
2 Solutions

Accepted Solutions
Marc
Employee
Employee

I'm not sure what the exact command would be in the SDK. 

however from the Rest API's you would be doing a PUT 

https://qlik.dev/apis/rest/apps/#%23%2Fentries%2Fv1%2Fapps%2F-appId%2Fpublish-put

Republishes a published app to a managed space,

However because you have imported a new App, that App ID is not associated with the published copy, so when making the api call, in the Request Body you need to specify checkOriginAppId=false

 

View solution in original post

DaveChannon
Employee
Employee

We do have a few examples of this flow, take a look at https://github.com/qlik-oss/qlik-cloud-examples/blob/665aff509acf5217366efa396c926bbd6abad11a/qlik.d... and let us know if that helps?

View solution in original post

4 Replies
Marc
Employee
Employee

I'm not sure what the exact command would be in the SDK. 

however from the Rest API's you would be doing a PUT 

https://qlik.dev/apis/rest/apps/#%23%2Fentries%2Fv1%2Fapps%2F-appId%2Fpublish-put

Republishes a published app to a managed space,

However because you have imported a new App, that App ID is not associated with the published copy, so when making the api call, in the Request Body you need to specify checkOriginAppId=false

 

richardpearce60
Contributor II
Contributor II
Author

Thanks Marc it worked. I'd seen this flag but not used it (or used it properly)

republished_app = application.set_publish({"targetId": "90276b41-02fb-4a19-b2c0-0c25d3c0da37","checkOriginAppId":False})

I've been trying to use the SDK when I can although I'm not 100% convinced with it... it does sometimes give additional help (not every time)

The code above would be a PUT... So (for others) targetId is the application id currently published and the flag means overwrite (no need for a space id)

DaveChannon
Employee
Employee

We do have a few examples of this flow, take a look at https://github.com/qlik-oss/qlik-cloud-examples/blob/665aff509acf5217366efa396c926bbd6abad11a/qlik.d... and let us know if that helps?

richardpearce60
Contributor II
Contributor II
Author

Thanks Dave! Just read through them and they do help! 🙂