Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
Please help us to fetch the Status and Completed data from the NPrinting API. you can use any host & NPrinting Task Id in below url.
REST API : https://host/api/v1/tasks/taskid/executions
QLik Script:
LIB CONNECT TO 'NPrinting REST_POST';
let vPublshTaskURL = 'https://host/api/v1/tasks/'&'$(vTaskId)'&'/executions';
RestNPTaskTriggerTable:
SQL SELECT
"__KEY_data"
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION( URL "$(vPublshTaskURL)", HTTPHEADER "cookie" "$(vCookie)");
[_post_items]:
LOAD [__KEY_data] AS [__KEY_data]
RESIDENT RestNPTaskTriggerTable
WHERE NOT IsNull([__KEY_data]);
DROP TABLE RestNPTaskTriggerTable;
Hi,
Your question is not detailed enough.
Do you want to get a Status and Completed for all your executions or for any particular one? Remember that the same task can have hundreds of executions and you will not know which one is which one.
in this link https://nprintingadventures.wordpress.com/2019/04/08/nprinting-api-qlik-rest-subroutines/ you will find script and subroutines which can be used to get a data you want.
in particular you might want to focus on lines: 1417 - 1495 about " GET LAST EXECUTION". Note that i use it in conjuction with actual task currently running, so it is a part of another subroutine called: "SUB NP_TriggerTasks"