Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
dutoitan
Contributor
Contributor

QlikView NPrinting November 2019 Automate Import Task

Good Day

I have a "trigger" qvw which automates an NPrinting job, i.e. kicks off the generate recipients task and then kicks off the publish report task.

As the import task wasn't supported by the API this step remains a manual NPrinting trigger.  However, I would like to have this included in the automation.

I read that the June 2019 version of NPrinting supports import tasks on the API:

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

However, I am not able to find any documentation related to this. Also when I get the task list using the API only publish tasks are included.

Can anyone assist?

Thanks

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You are right, I could not get import tasks listed when executing GET call.

However what I tried was to execute task using POST method and instead of {id} I put id (I hardcoded it), which I derived from URL address when looking at Import task in management console and it all worked ok. 

Screenshots below:

Import task in admin consoleImport task in admin console

 

Qlik Sense script triggering that importQlik Sense script triggering that import

 

I am attaching also short video of execution which shows following obvious steps:

  • loading NPrinting.qvs library which handles most of below calls
  • authentication to NPrinting to grab session Cookie (Call NP_Authenticate)
  • connecting to POST connection - hardcoded
  • triggering Import task - hardcoded
  • checking status of this task (Call NP_GetExecutions('TaskId')) and  (Call NP_GetExecutionDetails('TaskId'))
  • the above steps are ensuring that import is finished before next task can be triggered.

NPrinting.qvs library is available on my blog: https://nprintingadventures.com/ under this post: https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

This library is my private project so use it at your own risk, but I think it can simplify a lot in task chaining using API.

hope this helps - cheers

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

2 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You are right, I could not get import tasks listed when executing GET call.

However what I tried was to execute task using POST method and instead of {id} I put id (I hardcoded it), which I derived from URL address when looking at Import task in management console and it all worked ok. 

Screenshots below:

Import task in admin consoleImport task in admin console

 

Qlik Sense script triggering that importQlik Sense script triggering that import

 

I am attaching also short video of execution which shows following obvious steps:

  • loading NPrinting.qvs library which handles most of below calls
  • authentication to NPrinting to grab session Cookie (Call NP_Authenticate)
  • connecting to POST connection - hardcoded
  • triggering Import task - hardcoded
  • checking status of this task (Call NP_GetExecutions('TaskId')) and  (Call NP_GetExecutionDetails('TaskId'))
  • the above steps are ensuring that import is finished before next task can be triggered.

NPrinting.qvs library is available on my blog: https://nprintingadventures.com/ under this post: https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

This library is my private project so use it at your own risk, but I think it can simplify a lot in task chaining using API.

hope this helps - cheers

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

by the way... The only official documentation regarding API is on https://help.qlik.com. The latest is: https://help.qlik.com/en-US/nprinting/June2020/Content/NPrinting/Extending/NPrinting-APIs-Reference-...

however it does not mention anything on how to programatically obtain import task id. 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.