Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

QRS API call to export and save a Qlik Sense application using Powershell

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

QRS API call to export and save a Qlik Sense application using Powershell

Last Update:

Sep 9, 2021 4:49:22 AM

Updated By:

Sonja_Bauernfeind

Created date:

Oct 9, 2018 9:19:39 AM

This article explains how to using QRS API a user can export and save a Qlik Sense application using Powershell.


Environment:

  • Qlik Sense Enterprise November 2017 and later

 

Resolution:


The below script exports the app to the C:\temp folder as test.qvf. Make sure to create the C:\temp folder beforehand

$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","EzFIU5eur2XQBfW7")
$hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$servername = "https://qlikserver2.domain.local"

$url = $servername+":4242/qrs/app/3b56d983-b359-4e40-8711-75012814cd70/export/9d8e95a5-9c67-4b6b-8a74-78f3a7bd88e2?xrfkey=EzFIU5eur2XQBfW7"
$output = "C:\temp\test.qvf"
$firstcall=Invoke-RestMethod -UseDefaultCredentials -Uri $url -Method Post -Headers $hdrs -Certificate $cert

$url2= $servername+$firstcall.downloadPath
Invoke-RestMethod -UseDefaultCredentials -Uri $url2 -Method Get -ContentType 'multipart/form-data' -OutFile $output


 

Labels (1)
Version history
Last update:
‎2021-09-09 04:49 AM
Updated by: