Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey there,
I'm currently using Qlikview and the REST Api to trigger Nprinting tasks after rebuilds complete. This was working great until I migrated to Nprinting June 2020. I initially had the issue with making get requests which I was able to solve by changing my vCookie definition as follows:
Let vCookie = TextBetween('$(vCookieRaw)','SameSite=None,','Path=/',3);
However, when running the POST request to actually execute the task I'm getting the below error. Is there some special way the cookie needs to be passed for POST tasks?
QVX_UNEXPECTED_END_OF_DATA: HTTP protocol error 401 (Unauthorized):
Requested resource requires authentication.
RestNPTaskTriggerTable:
SQL SELECT
"__KEY_data"
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION( URL "https://server:4993/api/v1/tasks/f6edca21-a7b6-4c2d-99b9-3f33e85cd1a2/executions", HTTPHEADER "cookie" "NPWEBCONSOLE_SESSION=e07b9480b597e133421c5fadf639eefeff9f3b29-%00userlogin%3A2020-07-09T22%3A25%3A01.4661030Z%00%00NPWEBCONSOLE_XSRF-TOKEN%3A7UnKpJHywEXtFZscrc1hYcb1P7YyHZ8ryGj%2FOxPLkwM%3D%00%00_TS%3Asession%00%00userid%3A3425d8703ccc440584b121cf0bf23b43%00; ")
An update, I've solved adding exactly the same text insert in origin header of POST as trusted origin in NPrinting. http or https make difference.
Hello @nsm1234567, I've got the same error using QV 12.50, REST connector 2.11 and NPrinting June 2020 (Initial release). Have you found any solution?
Thanks
An update, I've solved adding exactly the same text insert in origin header of POST as trusted origin in NPrinting. http or https make difference.
Please check this following community article:
The 401 error is addressed therein.
Kind regards...
Hey there, only saw this now! Didn't get notified that there were responses to my post, but yes, after a bunch of fiddling eventually discovered that the issue was exactly that: On Nprinting, I needed to whitelist http://localhost explicitly and on the REST side I needed http://localhost to be the origin. I can confirm this still works in Nprinting November 2020
Hey there, thanks for the response. I don't think this exact error is covered or is perhaps just not super clear. The issue here was that in previous documentation I'd seen online for the API you could do something like, "origin=localhost" in the post call and then have http://localhost in the whitelisted origins on Nprinting side, which worked until June 2020. After the upgrade, you had to use "origin=http://localhost" i.e. it had to include the "http" piece.
If you are having issues after upgrading recently, please check the following article as there have been problems with the Qlik Sense rest connector that have been resolved as well as changes to the the load script that are necessary in conjunction with the fixes.
Kind regards...
Please feel free to check the load script in the attached QVF to check against your own work.
This QVF load script (data included with export) allows:
It was also not working for me as well after a recent upgrade. The issue was resolved after performing the steps in the article mentioned above and upgrading Qlik Sense to Sept. 2020 Patch 2.
I would avoid using 'localhost' and use the actual server name in the load script.