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: 
poojask123
Partner - Creator
Partner - Creator

NPrinting API call from Sense script

Hi,

 I am trying to call my Nprinting server using api's in the sense script but the cookie format being generated looks incorrect because of which the connection to NP is failing.

As per Qlik documentation, a cookieraw must have 3 parts, the first part starting "NPWEBCONSOLE-XSRF-TOKEN..."

but the cookieraw i am getting from qlik sense has only 2 parts, and is starting from "NPWEBCONSOLE_SESSION...",

i tried the same connection in QlikView script and it works fine with the correct cookie format. 

Can some one please help.

 

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

So first of all your Nprinting is not supported with Qlik Sense June 2020. You must run the same or newer version of Nprinting (vs qliksense). Options? Upgrade Nprinting to June 2020 Patch x or September 2020. This will not solve cookie issue though as second thing is that you are using Qlik Sense which has changed Rest Connector. QlikSupport recommended to change the connector to use older versions (instead of the one which comes with QS June 2020) Details are available on community.. 

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

4 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

This is complicated subject. It depends on version of Qlik Sense and version of NPrinitng you are using.

If version of NPrinitng is as you indicated November 2019 you must use Qlik Sense November 2019 or older (as only such configuration is supported). If you do you can follow this setup: https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/ and it should work for you.

If you are running some other versions than subject becomes even more complicated as cookie was changing between versions as well as the Rest connector has changed too messing up everything. More here: https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Nprinting-REST-API-broke-after-June-2020-up...

 

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.
poojask123
Partner - Creator
Partner - Creator
Author

Thank you for the response Lech.

The QS version I am running is June 2020. 

The cookie definition i am using is 

Let vCookie = TextBetween('$(vCookieRaw)','SameSite=None,','Path=/',1);

 because the below doesnt work.

Let vCookie = TextBetween('$(vCookieRaw)','SameSite=None,','Path=/',2);

Let me try with the newer version of the restconnector as per your reference post. 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

So first of all your Nprinting is not supported with Qlik Sense June 2020. You must run the same or newer version of Nprinting (vs qliksense). Options? Upgrade Nprinting to June 2020 Patch x or September 2020. This will not solve cookie issue though as second thing is that you are using Qlik Sense which has changed Rest Connector. QlikSupport recommended to change the connector to use older versions (instead of the one which comes with QS June 2020) Details are available on community.. 

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.
poojask123
Partner - Creator
Partner - Creator
Author

Thank you Lech. Moving to the an older version(2.28) of the rest connector solved my cookie issue. Its all working as expected now.