Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone. Im trying to find a way to get the current installed Patch trough the QRS API. If you use the /about endpoint you can get the build number. But that doesnt include the Patch version as far as i can see. Is there another endpoint that give you the patch version or the full version?
EX: "Qlik Sense April 2019 Patch 4"
Unfortunately this information is not exposed at the QRS layer and you will need to go over the Qlik Proxy Service to access the needed endpoint. In a Windows environment, you can use the Invoke-RestMethod module combined with the -UseDefaultCredentials param to pass along the Windows creds. For example:
$hdrs = @{}
$hdrs.Add("X-Qlik-Xrfkey","examplexrfkey123")
$Data = Get-Content C:\ProgramData\Qlik\Sense\Host.cfg
$FQDN = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($($Data)))
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
Invoke-RestMethod -Uri "https://$($FQDN)/api/about/v1/systeminfo?xrfkey=examplexrfkey123" -Method Get -Headers $hdrs -ContentType 'application/json' -UseDefaultCredentials
Response on my end on my April 2020 server:
contentHash : ec920dc6f950777b197502e2e8710c32
senseId : qliksenseserver:13.72.3
originalClassName : Composition
version : 13.72.3
deploymentType : QlikSenseServer
releaseLabel : April 2020
deprecatedProductVersion : 4.0.X
productName : Qlik Sense
copyrightYearRange : 1993-2020
Hi Levi. Thank you for you replay.
I was hoping to get it from another place then the proxy. The reason is that my script probably cannot use the current credentials. the only response i get is HTML (my guess the login form). In that case I need a way to pass on the authentication of the current user like "-UseDefaultCredentials" does in powershell.
Is there any other place i can get it? Maybe in the windows registry or similar?
So it looks like you have a couple of options:
On my end, I have a secondary virtual proxy with the prefix of form which has forms configured and this code is running for me:
# Define your prefix
$virtualProxyWithForms = 'form/'
# Get the ticket
$hdrs = @{}
$hdrs.Add("X-Qlik-Xrfkey","examplexrfkey123")
$hdrs.Add("X-Qlik-User", "UserDirectory=INTERNAL; UserId=sa_api")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$Data = Get-Content C:\ProgramData\Qlik\Sense\Host.cfg
$FQDN = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($($Data)))
$body = '{"UserDirectory": "DEMO", "UserId": "xyz", "Attributes": [{"attribute": "value"}]}'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
$ticket = Invoke-RestMethod -Uri "https://$($FQDN):4243/qps/$($virtualProxyWithForms)ticket?xrfkey=examplexrfkey123" -Method Post -Body $body -Headers $hdrs -ContentType 'application/json' -Certificate $cert
# Use the ticket and request the version info
$hdrs = @{}
$hdrs.Add("X-Qlik-Xrfkey","examplexrfkey123")
Invoke-RestMethod -Uri "https://$($FQDN)/$($virtualProxyWithForms)api/about/v1/systeminfo?xrfkey=examplexrfkey123&qlikTicket=$($ticket.Ticket)" -Method Get -Headers $hdrs -ContentType 'application/json'
Hi again Levi.
I thank you for your example and I can probably use it later on. But for this issue i need something more universal. The script is designed to run on any QlikSense Server. And not many QS Serves have forms authentication setup by default. It would have worked if you could use it on Win authentication (since almost off installation use that as default).
I though this would be pretty simple, but it looks like i was mistaken haha. I can authnenticate to the QRS using certificates. I cant do that same for the proxy in some manner?