Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today

Run "Import" QRS request using Qliksense Rest Connector (Post Request)

Hi there,

I'm currently looking to automate a process where apps are moved from our production server to a QA server.  Everything was running fine until I attempted to import the app on the QA server.  I have the below powershell script that I wrote which works 100% and imports and app to the server, but attempting to do the same thing with the Qliksense Rest connector doesn't work (I'd prefer to have this run in Qliksense so it can be managed by other developers).  Below I've pasted screenshots of my setup.  Can Qliksense not do this kind of connect?  It gives me an error saying "403 (No client certificate supplied)"

Working powershell script:


$hdrs = @{}
$hdrs.Add("X-Qlik-User", "UserDirectory=internal; UserId=sa_repository")

$CertPath = "C:\ProgramData\Qlik\Sense\Engine\Certificates\client.pfx"
$CertPass = "something"
$Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertPath, $CertPass)

$body = @{
    "name" = "simple_test.qvf"
    "ContentType" = "application/json; charset=utf-8"

} | ConvertTo-Json


add-type @"
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    public class TrustAllCertsPolicy : ICertificatePolicy {
        public bool CheckValidationResult(
            ServicePoint srvPoint, X509Certificate certificate,
            WebRequest request, int certificateProblem) {
            return true;
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

Invoke-RestMethod -Uri "https://server:4242/qrs/app/import?xrfkey=0123456789abcdef&name=test_import" -Method Post -Headers $hdrs -Body {"simple_test.qvf"} -ContentType 'application/json'  -Certificate $cert

Not working Rest connect from Qliksense:






Labels (3)