Skip to main content
Announcements
Talend Data Catalog 8.0 End of Support: December 31, 2024 Get Details

Qlik Sense SaaS: Export an app with the REST API (PowerShell)

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Damien_V
Support
Support

Qlik Sense SaaS: Export an app with the REST API (PowerShell)

Last Update:

Apr 4, 2023 3:49:22 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 23, 2021 10:31:10 AM

This is a sample on how to export an app from Qlik Sense SaaS using the REST API.

The API documentation can be found here: https://qlik.dev/apis/rest/apps#%23%2Fentries%2Fapps%2F-appId%2Fexport-post

The example provided in this article is for demonstration purposes only. Support and modifications cannot be supported. For further assistance, please see our Qlik Sense Integrations and API forum.

The below demonstrates how to call the API to export the app and download the file.

The API call itself will create a temporary file of the exported app that needs to be downloaded with a separate call. The URL to the temporary file is returned in the response header "Location".

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$tenantname = "https://mytenant.eu.qlikcloud.com"
$apikey ="eyJhbGciOiJ...sxhFexiXQPUdpkNE0Z"
$appid ="8d5919f3-5131-49fe-8a14-5d8d1e8c9b22"

$hdrs = @{}
$hdrs.Add("Authorization","Bearer "+$apikey)
$hdrs.Add("content-type","application/json")
$url = $tenantname+"/api/v1/apps/"+$appid+"/export"
$resp = Invoke-WebRequest -Uri $url -Method Post -Headers $hdrs

$tempFileUrl = $tenantname+$resp.Headers.Location

Invoke-WebRequest -Uri $tempFileUrl -OutFile "C:\temp\exportedfile.qvf" -Headers $hdrs
Labels (2)
Comments
CreoLabs
Contributor II
Contributor II

Hi,
This is very helpful for sharing apps between tenants.

I'm using Qlik REST connector to activate all QLIK REST APIs and use WITH CONNECTION to run all calls.
Maybe you can assist with the last step of [-OutFileUrl] on how to implement it using WITH CONNECTION approach in Qlik script.
Thanks in advance.

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @CreoLabs 

I recommend posting about your requirement in our Integrations and API forums. There, you will have access to our active userbase as well as our active support agents.

All the best,
Sonja 

CreoLabs
Contributor II
Contributor II

OK. Thanks

 

William_Wistam
Contributor III
Contributor III

Will this work with any file in QS SaaS? QVDs? Excel?

CreoLabs
Contributor II
Contributor II

It's not a problem with any data file - you can make STORE to any cloud storage location easily.

The problem is with the application itself - this script should support export of the app itself

Version history
Last update:
‎2023-04-04 03:49 AM
Updated by: