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: 
Sahal
Creator II
Creator II

Qlik REST connector between QlikView and Nprinting - 403 Forbidden

Hi,

We are trying to set up a connection (trigger) between QlikView and Nprinting by using Qlik REST connector.

We downloaded the latest Qlik REST connector v.2.11 and have QlikView (April 2020 SR4) v 12.50.20400.0 and Nprinting (September 2020) v20.31.2.0

We followed the new article Run a Qlik NPrinting API POST command via QlikView... - Qlik Community - 1822137 but got stuck on error:

Capture.PNG

The error 403 "The user is not authorized to create a new connection."  (Qlik NPrinting API − post /connections - Qlik | Help) however, what credentials should we use? - Is it the services account that runs QlikNprinting? (We are using Win NTLM so i guess that is should be the service account? - Domain\serviceaccount)

The trusted origin  (Admin->Settings->On-Demand ) on Nprinting server is setup to point at QlikView (Where the QDS is installed)

The installation of the Qlik REST connector  was a simple "next - next - next

If we look at the URL https//yourNprintingServer:4993/api/v1/login/ntlm it  fails if we copy/paste it to a web-browser (should we be able to access anything from a web-browser?)

User name: doman\serviceaccount

Capture.PNG

The Query Headers are the same name and value (http://...) of the Nprinting origin.

Capture.PNG

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

What user should you use? User with Administrator role in NPrinting console and Domain account properly populated:

2.jpg

Your statement here is not entirely right:

If we look at the URL https//yourNprintingServer:4993/api/v1/login/ntlm it  fails if we copy/paste it to a web-browser (should we be able to access anything from a web-browser?)

question to the above: where in the that question you define method of your connection (GET or POST)?...exactly - nowhere, which is why you get a default response (GET) by running it from web browser. The main reason is that GET method by default does not require BODY of the message you are sending via URL. 

So when you copy/paste the URL https//yourNprintingServer:4993/api/v1/login/ntlm to the browser by default you get a GET command response which is working for you already judging by fact that you followed instructions and you got stuck on POST connection setup - that is in later stages of instruction steps.

 

 

Below is the walkthrough I just stiched up quickly for presentation.

In a GET connection I did not used query headers at all and my connection works OK

2021-07-22_09-29-22 (1).gif

In POST method I used headers Origin - value: https://myqlikview servername. The same value for origin needs to be populated in NPrinting-->ADMIN-->Settings-->OnDemand-->Trusted origin list.

Bit I am unclear is when you say: "The Query Headers are the same name and value (http://...) of the Nprinting origin."

So just want to confirm that this is the same value in both places: address of the qlikview server.

2021-07-22_09-38-51 (1).gif

1.jpg

cheers

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

2 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

What user should you use? User with Administrator role in NPrinting console and Domain account properly populated:

2.jpg

Your statement here is not entirely right:

If we look at the URL https//yourNprintingServer:4993/api/v1/login/ntlm it  fails if we copy/paste it to a web-browser (should we be able to access anything from a web-browser?)

question to the above: where in the that question you define method of your connection (GET or POST)?...exactly - nowhere, which is why you get a default response (GET) by running it from web browser. The main reason is that GET method by default does not require BODY of the message you are sending via URL. 

So when you copy/paste the URL https//yourNprintingServer:4993/api/v1/login/ntlm to the browser by default you get a GET command response which is working for you already judging by fact that you followed instructions and you got stuck on POST connection setup - that is in later stages of instruction steps.

 

 

Below is the walkthrough I just stiched up quickly for presentation.

In a GET connection I did not used query headers at all and my connection works OK

2021-07-22_09-29-22 (1).gif

In POST method I used headers Origin - value: https://myqlikview servername. The same value for origin needs to be populated in NPrinting-->ADMIN-->Settings-->OnDemand-->Trusted origin list.

Bit I am unclear is when you say: "The Query Headers are the same name and value (http://...) of the Nprinting origin."

So just want to confirm that this is the same value in both places: address of the qlikview server.

2021-07-22_09-38-51 (1).gif

1.jpg

cheers

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.
Sahal
Creator II
Creator II
Author

Hi, 

Great help! 

Everything was setup correctly except the Query headers "Name" I used the Query headers name and value the i setup in Nprinting but that is not correct. 

In Nprinting when creating a trusted origin you type in name = QlikviewServerName and Address = http(s)://QlikViewServerName

But in the REST connection you type in Name = origin and Valuehttp(s)://QlikViewServerName