Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QlikSense Import App via QRS and Powershell

Hi,

I'm trying to get Powershell to import an App on the central node of a QS 2.1.1 deployment. It is multi-node (if that makes any difference).

So far, I have successfully set up a Virtual Proxy for header auth and tested it using such commands as:

<server>/qrs/user/count?xrfkey=<xrfkey>

and all the relevant headers. This powershell script is based on QRSAPI - Remove Unwanted Users with PowerShell

However, when I come to use the "/qrs/app/import?name={name}&keepdata={keepdata}&replace={replace}" call

API ref: https://help.qlik.com/sense/2.1/en-US/developer/#../Subsystems/RepositoryServiceAPI/Content/Reposito...

I'm getting a "The remote server returned an error: (403) Forbidden." response.

I'm getting a "The remote server returned an error: (400) Bad Request" (I'd missed off the xrfkey in the above error on this specific call - doh)

The App is in %ProgramData%\Qlik\Sense\Apps folder.


Details:

----------

POST request to: http://<machinename>/<prefix>/qrs/app/import?name=<app name to be assigned>


Xrfkey, UserId and headers required by the virtual proxy have all been set correctly (I believe).



body = "{

            'id':'00000000-0000-0000-0000-000000000000',

            'columns':

                [

                    {

                        'name':'current_filename.qvf',

                    }

                ]

        }"


content type = "application/json"


I'm pretty certain that it is down to my usage of this API call as GET requests seem to work fine. Can anyone help please?


Thanks,


Dave

11 Replies
Anonymous
Not applicable
Author

Thanks Dave for quick response. I could solve the issue. The issue was with the file location where it was kept. I kept the file at \ProgramData\Qlik\Sense\Apps\ location. But form 3.0 onwards we need to keep the file based on the user in \ProgramData\Qlik\Sense\Apps\<LoginDomain>\<user>\ folder. After I moved the file to this location, it got imported successfully.

jainisha
Partner - Contributor II
Partner - Contributor II

Thanks. This helps. 

File needs to be kept under login domain user otherwise it gives "The specified filename is invalid." error and you won't able to figure out issue from description.

This should be added in documentation.