Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!

Qlik Cloud: How to Export apps from Managed spaces or unpublish an app with the REST API or Qlik-CLI

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
Sonja_Bauernfeind
Digital Support
Digital Support

Qlik Cloud: How to Export apps from Managed spaces or unpublish an app with the REST API or Qlik-CLI

Last Update:

Feb 5, 2024 4:12:00 AM

Updated By:

Sonja_Bauernfeind

Created date:

Nov 12, 2020 6:37:19 AM

Qlik Cloud has a built-in method to export apps from your managed spaces, along with APIs available which allow for automation. 

Content:

 

Export apps from Managed spaces (native method)

This is the recommended method.

As of the 30th of January 2024, Qlik Cloud has introduced the functionality to Export apps from Managed Spaces.

Space Owner and users with the "Can Manage" role, can now export Qlik Cloud apps from Managed Spaces.

These apps can only be exported without data. Storytelling is not exported.

This possibility allows you to re-establish a parent - child relation of your source and published apps, in case the source app was accidentally deleted.

For more information, see:

 

Export apps using the Rest API 

You can also export the app from a managed space without data through the REST API or Qlik Cli in a supported way. 

These apps can only be exported without data, even if the NoData parameter is not set to true. Storytelling is not exported.

Method One: REST APIs

Requirements:

  • PowerShell
  • API keys enabled
  • The App ID
  • Your tenant URL
$hdrs = @{}
$hdrs.Add("Authorization","Bearer eyJhbGciOiJFUzM4NCIsImtpZCI6IjUzYj...VJaO0zSKZs7Q")
$tenanturl =  "https://yourtenant.ap.qlikcloud.com"
$appid = "7972e3ae-df5c-4ed3-81f4-e2220d76972d"
$url = $tenanturl+"/api/v1/apps/"+$appid+"/export?NoData=true"
 
$output = "C:\temp\MyExportedApp.qvf"
$firstcall=Invoke-WebRequest -Uri $url -Method Post -Headers $hdrs
 
$url2= $tenanturl+$firstcall.Headers.Location
echo $url2
Invoke-RestMethod -Uri $url2 -Method Get -Headers $hdrs -ContentType 'multipart/form-data' -OutFile $output

Reference: 

 Exports a specific app | Qlik Developer

 

Method Two: Qlik-Cli:

qlik app export 7972e3ae-df5c-4ed3-81f4-e2220d76972d --NoData > C:\temp\MyExportedApp.qvf

Reference:

app export | Qlik Developer

 

Unpublish an app with the REST API

Alternatively, an app can be unpublished from a Managed space and obtained for editing. This method maintains data, including storytelling.   

Use this method at your own risk. Direct API calls make changes which bypass safety nets and the end result can lead to unexpected results. 

Requirements:

  • PowerShell
  • API keys enabled
  • The App ID
  • Your tenant URL

Method One: REST APIs

This will move the app from a Management Space to your Personal space with the REST API.

  1. Create an API key to perform the call. First of all. See https://qlik.dev/tutorials/generate-your-first-api-key
  2. Using PowerShell, execute the following:
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    
    $body='{"spaceId":""}'
    $hdrs = @{}
    $hdrs.Add("Authorization","Bearer eyJhbGciOiJM4ImtpZCI6IjBkZmQ5YzM2LTcy...YLmG54QLpd")
    $hdrs.Add("content-type","application/json")
    $url = "https://yourtenant.eu.qlikcloud.com/api/v1/apps/APPID/space"
    Invoke-RestMethod -Uri $url -Method Put -Headers $hdrs -Body $body

    Replace: 

    eyJhbGciOiJM4ImtpZCI6IjBkZmQ5YzM2LTcy...YLmG54QLpd with the API key you've generated
    yourtenant.eu.qlikcloud.com with your tenant URL
    APPID with your app ID 

    Tip: Get the App ID directly from the hub URL when you have the App open.

    Unpublish App.gif

  3. After the command is executed, the App will be moved to your personal space. This operation will retain bookmarks and sheets, though not their original owners. 

 

Troubleshooting:

See following article if any TLS/SLL error are output when running the PowerShell script:
Qlik Sense API: Could not create secure SSL/TLS channel (Powershell)

 

Method Two: Qlik-Cli

This will move the app from a Management Space to your Personal space with the REST API, wrapped in the QLIK-CLI.

Alternatively, if qlik-cli is installed, the following commands can be used. In the code, replace APPID with the correct one (e.g. 68aae8b0-3770-435d-951d-7b97469fb78b​). 

  1. Set the qlik-cli user as the owner (this is necessary if you don't want the app to go the original owner's personal space, in case they have left the company):
    qlik app owner APPID
  2. Move the app to the owner's personal space:
    qlik app space update APPID
  3. (Optional) once moved to the personal space, create a duplicate (to use as the new source app), and put back the original app in the original space. This way, all the dependencies and links to the published app will be kept:
    qlik app space update APPID​ --spaceId SPACEID​

The admin using the qlik-cli commands will need to have full permissions on the Managed space that hosts the app.

Use this method at your own risk. The direct API calls used in this workaround make changes which bypass safety nets and the end result can lead to unexpected results. 
Labels (2)
Comments
Sonja_Bauernfeind
Digital Support
Digital Support

Hello @sten_lomme Glad this worked! 

I am aware that our Ideation team is working on having the process improved, meaning you should be able to log in seamlessly whenever you click any link in the future.

All the best,
Sonja 

mgranillo
Specialist
Specialist

@Sonja_Bauernfeind do you know if any of these methods keep the personal sheets for all users? Its typical for us to have a few hundred unpublished personal sheets created by our users.  I tested the automation method and lost the personal sheets.

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @mgranillo 

This method is only meant to be used as a workaround if the original app has been lost and will bypass safety nets. It is specific to the published app and published content. I will reach out internally if we have anything on hand regarding personal sheets, but I believe that I will need to redirect the question to our API forum.

Will get back to you as soon as possible.

All the best,
Sonja 

Daniele_Purrone
Support
Support

Hi @mgranillo , I just tested this with the Qlik-cli and private sheets are preserved.
As the Qlik-cli is just a wrapper for the APIs, the API method is expected to work as well.

You can do some testing as well to confirm.

mgranillo
Specialist
Specialist

@Daniele_Purrone the CLI method is working for me but I'm seeing something strange.  After moving the app to the owner's personal space (step 2 above in method 2), I have non app owners that are able to see the app in their personal space.  The duplicate is appearing as well in a non-owners personal space.  The QMC does not show a copy in the non-owner's personal space yet I'm seeing the apps across two users. 

To boil it down another way, a user is seeing an app that they don't own in their personal space. What is going on here? 

mgranillo
Specialist
Specialist

@Sonja_Bauernfeind In this workaround, the app is pulled down from production.  Is that right? Our apps need to be up while we makes updates. A lot of our apps are utilized on a daily basis to answer business questions.  Some updates may take weeks. We can't have our apps down for weeks. Can nothing else be done?   

Is there any way to correct this so that we can overwrite the app again? 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @mgranillo 

To be able to assist you better (and to give you a chance to get access to a larger audience), please summarize what you are aiming to do and what you want to achieve, as well as what challenge you've been facing and post this in the API forum (if you are looking to build a solution using our APIs) or the App Development forum (if you are facing general app development/process challenges).

All the best,
Sonja 

Version history
Last update:
‎2024-02-05 04:12 AM
Updated by: