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: 
marpiotrowicz
Contributor III
Contributor III

Starting tasks in nprinting from Qlik Sense

After upgrade from Nprinting February 2020 to February 2020 Patch 1 starting tasks from qlik sense stopped working.

Yesterday everything was fine. 

There is a problem with post method. 

Wystąpił następujący błąd:
HTTP protocol error 403 (Forbidden): The server refused to fulfill the request.

I've checked:
On Demand settings in nprinting (name and address is correct - same as in Qlik Sense connections in Query headers section)

Report has option : Enable On-Demand and API report generation.

Get call is ok.
Could it be a Feb2020 patch1 problem?

My script:

let vTaskId='XXXXXX';

let vPublshTaskURL='https://nprinrintgaddress:4993/api/v1/tasks/'&'$(vTaskId)'&'/executions';

LIB CONNECT TO 'Nprinting REST Login (GET)';

 


//Perform a GET call to NPrinting NTLM login API
RestConnectorMasterTable:
SQL SELECT
"Set-Cookie",
"__KEY__response_header"
FROM JSON "_response_header" PK "__KEY__response_header";
[_response_header]:
LOAD [Set-Cookie] AS [Set-Cookie]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY__response_header]);
//Extracts session cookie from the API response
let vCookieRaw = Peek('Set-Cookie',0,'_response_header');
let vCookie = TextBetween('$(vCookieRaw)','Secure,','Path=/',2);
DROP TABLE RestConnectorMasterTable;


LIB CONNECT TO 'Nprinting REST Login (POST)';

 

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;

 

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

maybe your cookie variable is empty or has wrong content?

see my comment in below thread:

https://community.qlik.com/t5/Qlik-NPrinting-Discussions/NPrinting-Task-Execution-call-using-Rest-AP...

or here:

https://community.qlik.com/t5/Qlik-NPrinting-Documents/NPrinting-February-2020-Change-required-to-sc...

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

1 Reply
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

maybe your cookie variable is empty or has wrong content?

see my comment in below thread:

https://community.qlik.com/t5/Qlik-NPrinting-Discussions/NPrinting-Task-Execution-call-using-Rest-AP...

or here:

https://community.qlik.com/t5/Qlik-NPrinting-Documents/NPrinting-February-2020-Change-required-to-sc...

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.