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

NPrinting API Error from POSTMAN - Forbidden REVEL_CSRF tokens mismatch

Hi All,
I'm testing NPrining APIs (OnDemandRequest) from POSTMAN.
I used NTLM Auth and tried GET and it works.

https://<np_serverhost>:4993/api/v1/reports
After getting the Report ID, I tried POST call using the Report ID found from GET response.

https://<np_serverhost>:4993/api/v1/ondemand/requests
{
"type": "Report",
"config": {
"reportId": "0a0f095d-5109-4212-89d4-156bc3079469",
"outputFormat": "XLS"
}

I also added localhost to admin/settings > ondemand > trusted origin in NP Console.

It gives me an error.

Forbidden
REVEL_CSRF: tokens mismatch.

Please help in this regard. Thanks in advance.

@Frank_S , @Lech_Miszkiewicz@Ruggero_Piccoli  

Labels (2)
1 Solution

Accepted Solutions
sudeepkm_analog
Contributor III
Contributor III
Author

Sorry I forgot one step to add X-XSRF-TOKEN in my POST request header.

 I'm now able to make "POST" method call successfully.  

View solution in original post

3 Replies
Frank_S
Support
Support

@sudeepkm_analog 

Check your REST POST connection.

Ensure you have your Qlik Sense server inserted in the query header address as shown in the image below. In my case, the QS hub/QMC address is:

qlikserver1.domain.local

 

query header for Qlik Sense server hub QMC address.PNG

This address is also required as a trusted origin in the NPrinting management console

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sudeepkm_analog
Contributor III
Contributor III
Author

Hi @Frank_S 

Thanks for your quick response. In my case POSTMAN is the client that is making the API Call.

I'm not using QlikSense or QlikView to make the call.

I also checked the NPWEBCONSOLE_XSRF-TOKEN as mentioned here.(https://community.qlik.com/t5/Support-Knowledge-Base/How-to-Authenticate-Connect-with-the-Qlik-NPrin...

Still it does not work.

sudeepkm_analog
Contributor III
Contributor III
Author

Sorry I forgot one step to add X-XSRF-TOKEN in my POST request header.

 I'm now able to make "POST" method call successfully.