Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW

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
Ken_T
Specialist
Specialist

thank you for documenting this workaround!

rduregger
Partner - Contributor
Partner - Contributor

When I try this via method 1, I receive a 403 (Forbidden) response. I've double-checked my API key, app ID, and tenant URL. Are there additional headers I might need to include for authentication? 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @rduregger 

I recommend posting your query directly in our API and Extension forum, where our active user base and support agents can assist you.

All the best,
Sonja 

sten_lomme
Contributor III
Contributor III

Shouldn't this feature be part of native Qlik SaaS solution? Is there any plans on including this in the platform?

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @sten_lomme 

I recommend raising your interest in this idea in our Ideation app! This helps our product team see the features most requested by our customers and prioritise accordingly.

Here's the link to the app: Ideation 

All the best,
Sonja

jelzo_nl
Contributor
Contributor

This should be a console function

Users migrating from Sense Enterprise are used to deleting apps from their personal space and duplicating published apps from streams. In Sense SaaS, this will result in a 'lock out', where you cannot update the app anymore. This scenario is not uncommon and tenant admins should have this function availlable in the console.

Please upvote this idea to add this function to the development roadmap as soon as possible:
https://community.qlik.com/t5/Suggest-an-Idea/Qlik-Sense-SaaS-Duplicate-Export-App-from-Managed-Spac...


Method 3: Using Qlik Automation

You can also unpublish using Qlik Automation. This will move the app back to the owners personal space.

1. Create a new API key ({apiKey}).
2. Create the automation flow as shown below.
3. Add the app id to the appId variable
4. Create a new connection type='httpheader', authentication_name='Authorization', api_key='Bearer {apiKey}', base_url='{tenantId}.{region}.qlikcloud.com/api/v1/'
5. Run the automation
Unpublish app from managed space using Qlik AutomationUnpublish app from managed space using Qlik Automation

 

 

 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello, @jelzo_nl The old ideation system is no longer monitored by Qlik. 

Please vote on and refer to the new system we implemented a few months ago. This is the idea you referenced: Qlik Sense SaaS - Duplicate/Export App from Managed Space 

(If you receive a login error, you may need to log in directly to the app first.)

sten_lomme
Contributor III
Contributor III

@sOnO login to new ideation system does not work. Just redirects to Pendo login. But no luck.

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @sten_lomme 

I hope I have a workaround for you for this.

First, go to the Ideation page on Qlik community and click the card at the top with the link "Suggest Features" (screenshot attached). This will authenticate you into the portal. Then, you can exit it and then use the app links we sent above.

suggest idea.png

 

All the best,
Sonja 

sten_lomme
Contributor III
Contributor III

@Sonja_Bauernfeind  That did the trick. Not very intuitive, though.

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