Click the lock icon next to the URL > View Certificates
Click General > Install Certificate…
Follow the wizard, make sure to manually specify the installation location as the Trusted Root Certificate Authorities folder
Authenticate via NTLM credentials at /api/v1/login/ntlm at port 4993.
Save the Session and XSRF cookies somewhere.
Make subsequent requests using the cookies.
Note: POST requests require the X-XSRF-token header (with value from the XSRF cookie) is required. Note: Powershell defaults to TLS 1.0, and the April 2018 release uses TLS 1.1 minimum. You must force Powershell to use at least this version of TLS in April 2018 and higher.
Here is some example code that (1) Logs in to Nprinting as the user executing the script, (2) makes a GET request to retrieve the first task, and (3) makes a POST request to execute said task.
# Set TLS to minimum 1.1 for Nprinting Feb 2018, using 1.2 in this example
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Authenticate and get cookie
$url = "https://YOUR-NPRINTING-SERVER:4993/api/v1/login/ntlm"
Invoke-RestMethod -UseDefaultCredentials -Uri $url -Method Get -Headers $hdrs -SessionVariable websession
$cookies = $websession.Cookies.GetCookies($url)
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$session.Cookies.Add($cookies);
# Extract XSRF token from cookie
$xsrf_token = $($cookies | Where-Object {$_.Name -eq "NPWEBCONSOLE_XSRF-TOKEN"}).Value
# Get list of tasks in Nprinting
$hdrs = @{}
$hdrs.Add("X-XSRF-token",$xsrf_token)
$url = "https://YOUR-NPRINTING-SERVER:4993/api/v1/tasks"
$tasks = $(Invoke-RestMethod -WebSession $session -Uri $url -Method Get -Headers $hdrs).data.items
# Pick an arbitrary task (first one) and execute it
$taskid = $tasks[0].id
$url = "https://YOUR-NPRINTING-SERVER:4993/api/v1/tasks/$($taskid)/executions"
Invoke-RestMethod -WebSession $session -Uri $url -Method Post -Headers $hdrs
Note: Debugging or writing custom code is supported by the Qlik Professional Services or Presales teams. This example is provided for demonstration purposes to explain specific scenarios. No Support or maintenance is implied or provided. Further customization is expected to be necessary and it is the responsibility of the end administrator to test and implement an appropriate implementation for their specific use case.