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

NPrinting API Newbie - how to get reports, tasks, etc.

Familiar with Admin side of Qlik Sense and Nprinting but not so much the coding side.  I've created the API connection from Qlik Sense June 2020 patch 12 to Nprinting June 2020 SR1.  The connection is successful and when I go to select data I get a one row header and the option to insert the auto generated script and that's it. The insert script only returns the one row when I load it in Qlik Sense.  

The goal is to create an app with NPrinting Reports, Connections, Task schedule, etc.

I have a couple NPrinting Report reports enabled for On demand and API Report Generation.  

I'm not sure what to do next, how to use the GET Reports and such as explained in the Help Document.

Thanks in Advance!  

Labels (2)
1 Solution

Accepted Solutions
fgm001qlik
Contributor III
Contributor III
Author

Lech!!!  I had no idea the NPrinting Governance DB existed!  I've installed and connected it to the PostGres and it's giving us a lot of the info we needed!  Huge Help!

 

I definitely am going to dive more into the API and all the details you mentioned but this is a huge time saver for me - thank you!

View solution in original post

7 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You are touching very advanced topic here. First of all you must understand how NPrinting works and understand what are the ondemand and Api report generation checkboxes. In standard scenarios you dont even touch API, and instead you are using OnDemand report button extension to trigger. That requires very precise setup (when I am saying precise I mean there is many points and things you need to setup before you can use it and all of them are in https://help.qlik.com

There is no point to describe steps here as it would be as pointles as pasting 500+pages of nprinitng help content!!!

That is all about OnDemand report generation.

 

Now the API - What do you mean by: "The goal is to create an app with NPrinting Reports, Connections, Task schedule, etc." ?? API does not allow for any of this....

you can GET App info, or you can GET Connection info, You can trigger metadata reload vai api or abot it, you can GET report info or Task info and you can Run and abort task but you CANNOT CREATE any of those via API.

I have written NPrinitng.qvs library which if you are experienced with Qlik scripting you will be able to easily utilize as it is all written as QlikView/Qlik Sense procedures. I am using them to chain report generation as follows: Reload QS app--> Publish Report. It requires you to create 2 REST connections with GET and POST methods and other pieces can be handled by using "With Connection" commands... Those can be easily identified in my scripts.

Link to my API library: 

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

allso you may want to check other posts about API on https://nprintingadventures.com/

hope this helps!

 

 

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

Lech - thank you for the reply and information!  There is an existing NPrinting Environment with connections, apps, reports and tasks.  We want to connect Qlik Sense to it and pull in the list of reports, tasks, etc. so we have an overview of our NPrinting Inventory and when reports run is the goal right now.  I will have to get to your QVFs from my personal laptop as my work one here is blocking the site!

I feel like I have all the pieces I just don't know how to put them together.  I've read a series of posts that reference this piece I have but I'm not following how to use it in the script generation from the GET and POST connections I created:

NPWEBCONSOLE_XSRF-TOKEN=rJxOQ08k8UsWeCUQBMkrOeQEIjb8NAcIOeNq6tOy54U=; Path=/; Secure; SameSite=None,NPWEBCONSOLE_SESSION=1710a96e3b9348ce6610418aa270dafc26f90882-%00NPWEBCONSOLE_XSRF-TOKEN%3ArJxOQ08k8UsWeCUQBMkrOeQEIjb8NAcIOeNq6tOy54U%3D%00%00_TS%3Asession%00; Path=/; HttpOnly; Secure; SameSite=None,NPWEBCONSOLE_XSRF-TOKEN=DoGV7mm0PAuRs3KogX6rn+UnfBIVIhzQvh5uv6RvbJY=; Path=/; Secure; SameSite=None,NPWEBCONSOLE_SESSION=ba2fa770ba094bc81ad3c32444170109038aa39a-%00NPWEBCONSOLE_XSRF-TOKEN%3ADoGV7mm0PAuRs3KogX6rn%2BUnfBIVIhzQvh5uv6RvbJY%3D%00%00_TS%3Asession%00%00userid%3A78e338d1c7fc401e9554a11ebe5ff9ed%00%00userlogin%3A2021-03-09T22%3A19%3A33.6006238Z%00; Path=/; HttpOnly; Secure; SameSite=None

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

It is not qvf I am sharing with you but QVS (text file with Qlik script).

What you are sharing with us is just initial GET call to establish session cookie response.

In my .qvs file we are capturing it as a variable and we pass this later in each other call.  Now - in my blog post there are links to community posts which you absolutely must read in order to understand how this all works.

From the topics above I understand that you are rather looking for solution which will allow you to read repository content (reports, schedules etc...) If that is the case why don't you just use NPrinitng governance dashboard which covers all that anyway.

https://community.qlik.com/t5/Qlik-NPrinting-Documents/NPrinting-Governance-Dashboard/ta-p/1744538

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.
Ruggero_Piccoli
Support
Support

Hi,

I would like to inform you that starting from February 2021 you can get also the audit data via API in JSON format. If your goal is monitoring Qlik NPrinting this could be useful.

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

Lech!!!  I had no idea the NPrinting Governance DB existed!  I've installed and connected it to the PostGres and it's giving us a lot of the info we needed!  Huge Help!

 

I definitely am going to dive more into the API and all the details you mentioned but this is a huge time saver for me - thank you!

fgm001qlik
Contributor III
Contributor III
Author

Hi Ruggero -  thank you for this!  I want to follow up on this as I want to understand more on the API side which I'm novice on right now!

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

There is not much to follow up... that API Ruggero mentioned returns audit table and is also available in my Nprinting.qvs It returns from get call audit data. I have also written dedicated post on that on my blog https://nprintingadventures.com which covers api method of getting this data and direct connection to repo via postgres connector. 

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.