Skip to main content

How to Import a Qlik Sense App Via the QRS API

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

How to Import a Qlik Sense App Via the QRS API

Last Update:

May 11, 2021 5:59:09 AM

Updated By:

Sonja_Bauernfeind

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:

  1. 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.
  2. 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"

     

  3.  Place the App in the appropriate folder that was returned by the GET call to /qrs/app/importfolder
  4. 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"
    }

     

  5.  Verify the app was imported by navigating to the QMC > MANAGE CONTENT > Apps.
Labels (1)
Version history
Last update:
‎2021-05-11 05:59 AM
Updated by: