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

API based users import in Qlik NPrinting with a Qlik Sense app

Hi all,

i need to transfer all existing users from Qlik Sense to NPrinting. I found video that shows Qlik Sense applications that use API to synchronize users, but provided link to this app is no longer active. https://www.youtube.com/watch?v=WdHCAjerxcc 

Anyone from community knows how to do this? Maybe also you know other way to synchronize users?

Labels (2)
2 Solutions

Accepted Solutions
Ruggero_Piccoli
Support
Support

Hi,

Excel template development is explained in detail at https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/ExcelReports/Intro-Excel.htm

The Excel file created to import users must be exactly as explained in https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/DeployingQVNprinting/Import-Users-Fi...

You can download an example from https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/Examples/Examples.htm

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

Ruggero_Piccoli
Support
Support

Hi,

I did not understand what the issue is. Do you have a specific error message? In any case about QlikView and Qlik Sense APIs I suggest opening a question on related forums. You will have more chances to have an answer. 

About Qlik NPrinting API, you have to start with the NTLM authentication and extract the session cookie:

//Perform a GET call to NPrinting NTLM login API
RestConnectorMasterTable:
SQL SELECT
"Set-Cookie",
"__KEY__response_header"
FROM JSON "_response_header" PK "__KEY__response_header";
[_response_header]:
LOAD [Set-Cookie] AS [Set-Cookie]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY__response_header]);

//Extracts session cookie from the API response
let vCookieRaw = Peek('Set-Cookie',0,'_response_header');
Let vCookie = TextBetween(vCookieRaw,'SameSite=None,',' Path=/',SubStringCount(vCookieRaw,'SameSite=None')-1);

DROP TABLE RestConnectorMasterTable; 

There are many examples in the community like:

Official documentation is at https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/Extending/Intro-Extending.htm

Best Regards,

Ruggero

 



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

7 Replies
Ruggero_Piccoli
Support
Support

Hi,

You can use Qlik NPrinting to create and export an Excel file with users information from Qlik Sense and use the generated file in a Qlik NPrinting import user task. Then you can coordinate the execution of the two tasks via APIs.

Maybe this post https://community.qlik.com/t5/Qlik-Sense-Documents/Distribute-NPrinting-reports-after-reloading-a-Ql... cloud give you some more suggestions.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
krzohi
Contributor III
Contributor III
Author

Hi @Ruggero_Piccoli ,thank you for fast replay.

How to create this export to Excel file?

Ruggero_Piccoli
Support
Support

Hi,

Excel template development is explained in detail at https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/ExcelReports/Intro-Excel.htm

The Excel file created to import users must be exactly as explained in https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/DeployingQVNprinting/Import-Users-Fi...

You can download an example from https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/Examples/Examples.htm

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
krzohi
Contributor III
Contributor III
Author

Hi, i think i got the point, thanks!

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

you can also use the subroutines I have written for API simplification

https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

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

Hi,

i'm testing it on other machine and i'm facing with issue, that i'm not getting any values, no matter which api.

krzohi_0-1669101759530.pngkrzohi_1-1669101774571.pngkrzohi_2-1669101794532.png

krzohi_3-1669101833073.png

 

 

Ruggero_Piccoli
Support
Support

Hi,

I did not understand what the issue is. Do you have a specific error message? In any case about QlikView and Qlik Sense APIs I suggest opening a question on related forums. You will have more chances to have an answer. 

About Qlik NPrinting API, you have to start with the NTLM authentication and extract the session cookie:

//Perform a GET call to NPrinting NTLM login API
RestConnectorMasterTable:
SQL SELECT
"Set-Cookie",
"__KEY__response_header"
FROM JSON "_response_header" PK "__KEY__response_header";
[_response_header]:
LOAD [Set-Cookie] AS [Set-Cookie]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY__response_header]);

//Extracts session cookie from the API response
let vCookieRaw = Peek('Set-Cookie',0,'_response_header');
Let vCookie = TextBetween(vCookieRaw,'SameSite=None,',' Path=/',SubStringCount(vCookieRaw,'SameSite=None')-1);

DROP TABLE RestConnectorMasterTable; 

There are many examples in the community like:

Official documentation is at https://help.qlik.com/en-US/nprinting/May2022/Content/NPrinting/Extending/Intro-Extending.htm

Best Regards,

Ruggero

 



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.