Skip to main content

Qlik NPrinting

Discussion Board for collaboration on Qlik NPrinting.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Carly_
Contributor III
Contributor III

Nprinting REST API broke after June 2020 update

Goodmorning,

I have a failing script trying to call the Nprinting REST API after updating both Qlik and NPrinting to the June version. I also had this after the February update. The cookie is the problem in both cases. However, then I could easily change it by adjusting the TextBetween formula and now I cannot resolve the issue. Does anybody have an idea on how to change the cookie value so that the connection can be made again? 

I cannot find anything in the release notes this time. 

Labels (2)
3 Solutions

Accepted Solutions
eike_soecker
Partner - Contributor III
Partner - Contributor III

As a workaround you can also exchange the RestConnector for the previous version and with the Lech customization it works again. The REST Connector is located in the directory C:\Program Files\Common Files\Qlik\Custom Data. I couldn't test if other components of Sense June2020 need the newer connector.

View solution in original post

eike_soecker
Partner - Contributor III
Partner - Contributor III

I think Qlik would have to provide a separate link for this. I still had an April version on hand (see attachment, of course without warranty and without guarantee). Make a backup of the old folder first. Stop the engine, swap versions of the folders and restart the engine. As I said, this is all just a workaround.

View solution in original post

Patricia_Silva
Specialist II
Specialist II

Hello all,

Thank you for your patience 😊

R&D will release a permanent fix for this issue, but in the meantime you can apply the workaround mentioned on this article:

https://support.qlik.com/articles/000109904

Best Regards,
Patricia

Help users find answers! Don't forget to mark a correct resolution 🙂

View solution in original post

39 Replies
Lech_Miszkiewicz

correct - it is a cookie. I personally could not test it yet, but  I had someone posting this on my blog as a comment to this topic:

https://nprintingadventures.com/2020/03/27/nprinting-api-qlik-rest-subroutines-v1-2/

Let vCookie = TextBetween(‘$(vCookieRaw)’,’SameSite=None,’,’Path=/’,3);

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.
Carly_
Contributor III
Contributor III
Author

Hi Lech, 

Thank you for your answer. However, I'm afraid this doesn't work as the second part of the cookie does not contain, samesite = none anymore. I've tried to exclude the first part based on NPWEBCONSOLE, but this doesn't work for me

NPWEBCONSOLE_XSRF-TOKEN=wXH0YB5fA/E/jIe1OiCFHBBjrQ0j6DFeBTC6TxVY3Zw=; Path=/; Secure; SameSite=None,NPWEBCONSOLE_SESSION=1419836eb7b7def93ed8abc4eb550b2c67ebe98b-%00userid%3A2fa9fdbf125c4289b5541e0d2ee04196%00%00userlogin%3A2020-06-22T11%3A23%3A35.6842749Z%00%00_TS%3Asession%00%00NPWEBCONSOLE_XSRF-TOKEN%3AwXH0YB5fA%2FE%2FjIe1OiCFHBBjrQ0j6DFeBTC6TxVY3Zw%3D%00; Path=/; HttpOnly; Secure; SameSite=None 

Lech_Miszkiewicz

Sorry - I hadn't test it yet.

I may have some answers tomorrow.

Cheers

Lech

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.
Carly_
Contributor III
Contributor III
Author

No problem, I have tried multiple things, but I notice the cookie I get from the field set-cookie is completely different from earlier cookies. It only consists of 2 parts and it includes  a user login timestamp. No idea where this is coming from. 

It would be great if you have anything that can be of help tomorrow

Anubhavv
Contributor II
Contributor II

I also have the same issue and cannot figure out what to do. I am using April 2020 and the cookie i am getting is below

NPWEBCONSOLE_XSRF-TOKEN=gGWddTJJ7BPTZRNoGfFJ9vYmukd82U0unEUbvZbHULY=; Path=/,NPWEBCONSOLE_SESSION=e998a0652e2c0c148f19f8af93d617b3c599902c-%00NPWEBCONSOLE_XSRF-TOKEN%3AgGWddTJJ7BPTZRNoGfFJ9vYmukd82U0unEUbvZbHULY%3D%00%00_TS%3Asession%00; Path=/; HttpOnly

Not sure how to format it and use it further.!! Can someone shed some light?

Lech_Miszkiewicz

For April 2020 use this approach: https://community.qlik.com/t5/Qlik-NPrinting-Documents/NPrinting-February-2020-Change-required-to-sc...

https://nprintingadventures.com/2020/03/27/nprinting-api-qlik-rest-subroutines-v1-2/

 

 

For June 2020 you need to adjust highlighted part of code:

From:

//Extracts session cookie from the API response
Let vCookieRaw  = Peek('Set-Cookie',0,'cookie_items');
Let vCookie     = TextBetween('$(vCookieRaw)','SameSite=None,','Path=/',2);

To This - note change in red: TextBetween('$(vCookieRaw)','SameSite=None,','Path=/',3):

//Extracts session cookie from the API response
Let vCookieRaw  = Peek('Set-Cookie',0,'cookie_items');
Let vCookie     = TextBetween('$(vCookieRaw)','SameSite=None,','Path=/',3);

 

that works for me in June 2020

I will be adjusting my NPrinting.qvs soon and I will post about soon about it.

thanks

Lech

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.
eike_soecker
Partner - Contributor III
Partner - Contributor III

Thanks Lech, your solution works with the Sense April 2020 version. Or more precisely with the Rest Connector version 2.28.0, with Sense June 2020 comes a new version 2.34.0, with this version I could not successfully authenticate against NPrinting. A note from Qlik would be very helpful (@JonnyPoole ?, @Andrew_Kruger ?).

Carly_
Contributor III
Contributor III
Author

Thank you for your proposal, but indeed it is unfortunately not the solution for the June 2020 version in my case. 

eike_soecker
Partner - Contributor III
Partner - Contributor III

As a workaround you can also exchange the RestConnector for the previous version and with the Lech customization it works again. The REST Connector is located in the directory C:\Program Files\Common Files\Qlik\Custom Data. I couldn't test if other components of Sense June2020 need the newer connector.