Although there isn't a public API to start an import task in prior releases, it is possible to do it using the extracted private API as seen below. Please do keep In mind that, as this is a private API, it is not guaranteed to stay the same and must be rechecked/tested with each upgrade of NPrinting server.
The below examples are using a PowerShell script to call the private API while authenticating with JWT. The authentication part can be adapted to whatever method is being used to authenticate.
$body = ''
$hdrs = @{}
$hdrs.Add("Authorization","Bearer ...JWT-Token...")
$url = "https://nprintingserver:4993/npe/tasks/import/89ae9906-3c00-4004-adce-54dd6f13c43a/run"
Invoke-RestMethod -Uri $url -Method Post -ContentType 'application/json' -Headers $hdrs -body $body
Get the status:
$hdrs = @{}
$hdrs.Add("Authorization","Bearer ...JWT-Token...")
$url = "https://nprintingserver:4993/npe/tasks/import/89ae9906-3c00-4004-adce-54dd6f13c43a"
Invoke-RestMethod -Uri $url -Method Get -ContentType 'application/json' -Headers $hdrs
Result should look like this:{"result":{"steps":[{"configuration":{"filePath":"C:\\test\\SupportUsers.xlsx","configurationType":"excel"},"userMergeKey":"Name","entityMergePolicy":"UpdateMissing","associationMergePolicy":
"Merge","enabled":true}],"importFilePath":null,"userImportCreated":true,"userImportUpdated":true,"userRemoveNonExistent":true,"userRemoveNonExistentAssociations":true,"groupRemoveNonExistent":
false,"filterImportCreated":true,"filterImportUpdated":true,"filterRemoveNonExistent":true,"filterRemoveNonExistentFields":false,"lastTaskExecution":{"id":"d0077088-6dce-4bee-9a77-05b33f626a9b",
"version":12,"taskType":"Qlik.NPrinting.Task.ImportFiltersAndRecipientsEngineTask","priority":500.0,"created":"2019-05-06T08:23:42.589276","lastUpdate":"2019-05-06T08:23:44.097565","completed":
"2019-05-06T08:23:44.097565","progress":1.0,"config":{"DryRun":false,"TaskId":"89ae9906-3c00-4004-adce-54dd6f13c43a"},"status":"CompletedWithWarning",
"task":{"id":"89ae9906-3c00-4004-adce-
54dd6f13c43a","version":7,"name":"Import Users Support (Import task)","description":null,"created":"2018-04-10T21:41:44.568","lastUpdate":"2018-04-12T11:53:21","enabled":true,"lastExecution":
"2019-05-06T08:23:42.589276","nextExecution":null}},"id":"89ae9906-3c00-4004-adce-54dd6f13c43a","version":7,"name":"Import Users Support (Import task)","description":null,"created":
"2018-04-10T21:41:44.568","lastUpdate":"2018-04-12T11:53:21","enabled":true,"lastExecution":"2019-05-06T08:23:42.589276","nextExecution":null},"code":0,"message":null}NOTE:NPrinting June 2019 now officially supports import tasks. It has achieved this by extending support of the existing task API to included import tasks as well with the same endpoint. The following is an example of the endpoint to use for the public API:
POST /api/v1/tasks/{taskid}/executions