
Digital Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to Import a Qlik Sense App Via the QRS API
Last Update:
May 11, 2021 5:59:09 AM
Updated By:
Created date:
Aug 8, 2017 6:45:38 AM
In Qlik Sense, applications can be imported via the QRS API.
This is done by placing the application to import in a local folder, and then calling the /qrs/app/import endpoint.
Environment:
Qlik Sense Enterprise on Windows
To import an app via the QRS API, do the following:
- Setup the environment such that you can call the QRS API, as detailed in QRS API using Xrfkey header in Postman. Please note that you need Postman Interceptor installed and enabled.
- Make a GET call to /qrs/app/importfolder (not yet documented). Here is an example request/response:
Request:GET /qrs/app/importfolder?Xrfkey=abcdefghijklmnop HTTP/1.1 Host: qlikserver1.domain.local X-Qlik-Xrfkey: abcdefghijklmnop Cache-Control: no-cache Postman-Token: 9329144b-cb8b-b19c-5bb4-726bd96912b8
PowerShell sample:
Response Body:"C:\\ProgramData\\Qlik\\Sense\\Apps\\DOMAIN\\administrator"
- Place the App in the appropriate folder that was returned by the GET call to /qrs/app/importfolder
- Make a POST call to /qrs/app/import, as documented on Qlik Sense Developers to import the app. Note that there is a mistake in the documentation; the Content-Type header should be application/json (not text/plain). Also, it my be worth looking at Qlik Sense: API request errors when importing apps via QRS API if there are any issues. Here is an example request/response:
Request:POST /qrs/app/import?Xrfkey=abcdefghijklmnop&name=someAppName HTTP/1.1 Host: qlikserver1.domain.local X-Qlik-Xrfkey: abcdefghijklmnop Content-Type: application/json Cache-Control: no-cache Postman-Token: d02c29e5-a340-51b6-aa1f-8d350be6f511 "ABC Sales Data.qvf"
PowerShell sample:[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $body = '"apptoimport.qvf"' $hdrs = @{} $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB") $hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator") $url = "https://qlikserver1.domain.local:4242/qrs/app/import?xrfkey=iX83QmNlvu87yyAB&name=nameafterimport" $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'} Invoke-RestMethod -Uri $url -Method Post -Body $body -ContentType 'application/json' -Headers $hdrs -Certificate $cert
Response Body:{ "id": "aab16fd4-73bd-42ee-89d3-44d921e6218b", "createdDate": "2017-08-07T11:44:44.879Z", "modifiedDate": "2017-08-07T11:44:46.148Z", "modifiedByUserName": "INTERNAL\\sa_repository", "customProperties": [], "owner": { "id": "c8adc9c9-ebab-44fc-8038-69610755f0c4", "userId": "administrator", "userDirectory": "DOMAIN", "name": "administrator", "privileges": null }, "name": "someAppName", "appId": "", "publishTime": "1753-01-01T00:00:00.000Z", "published": false, "tags": [], "description": "", "stream": null, "fileSize": 558263, "lastReloadTime": "2017-06-16T08:59:19.019Z", "thumbnail": "", "savedInProductVersion": "12.11.6", "migrationHash": "64d115e925e2167bba72939c2d8a80e6beef4a56", "dynamicColor": "", "availabilityStatus": 0, "privileges": null, "impactSecurityAccess": false, "schemaPath": "App" }
- Verify the app was imported by navigating to the QMC > MANAGE CONTENT > Apps.
2,757 Views