<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: NPrinting API newbie question in Qlik NPrinting</title>
    <link>https://community.qlik.com/t5/Qlik-NPrinting/NPrinting-API-newbie-question/m-p/1917721#M35729</link>
    <description>&lt;P&gt;to follow up on Franks idea - the origin will be the machine you are trying to run your api call from&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2022 22:23:35 GMT</pubDate>
    <dc:creator>Lech_Miszkiewicz</dc:creator>
    <dc:date>2022-04-12T22:23:35Z</dc:date>
    <item>
      <title>NPrinting API newbie question</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/NPrinting-API-newbie-question/m-p/1917478#M35719</link>
      <description>&lt;P&gt;HI All&lt;/P&gt;
&lt;P&gt;Would like to start using the NPrinting API - in my case I would be calling it from PowerShell scripts&lt;BR /&gt;&lt;BR /&gt;I've read lots of stuff on the net and Qlik forums and have got so far but now a little stuck&lt;BR /&gt;In the example below I'm wanting to run an NPrinting task based on the ID&lt;BR /&gt;&lt;BR /&gt;The first section I authenticate and get cookie, then I&amp;nbsp;Extract XSRF token from cookie, I then try to execute the NPrinting task.&lt;/P&gt;
&lt;P&gt;# Authenticate and get cookie&lt;BR /&gt;$url = "&lt;A href="https://nprinting.corp.ourdomain.com:4993/api/v1/login/ntlm" target="_blank"&gt;https://nprinting.corp.ourdomain.com:4993/api/v1/login/ntlm&lt;/A&gt;"&lt;BR /&gt;Invoke-RestMethod -UseDefaultCredentials -Uri $url -Method Get -Headers $hdrs -SessionVariable websession&lt;BR /&gt;$cookies = $websession.Cookies.GetCookies($url)&lt;BR /&gt;$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession&lt;BR /&gt;$session.Cookies.Add($cookies);&lt;/P&gt;
&lt;P&gt;# Extract XSRF token from cookie&lt;BR /&gt;$xsrf_token = $($cookies | Where-Object {$_.Name -eq "NPWEBCONSOLE_XSRF-TOKEN"}).Value&lt;/P&gt;
&lt;P&gt;# Execute NPrinting task&lt;BR /&gt;$taskid = 'abd2531c-60e3-4057-917a-b1dd3730c1ed'&lt;BR /&gt;$url = "&lt;A href="https://nprinting.corp.ourdomain.com:4993/api/v1/tasks/$($taskid)/executions" target="_blank"&gt;https://nprinting.corp.ourdomain.com:4993/api/v1/tasks/$($taskid)/executions&lt;/A&gt;"&lt;BR /&gt;Invoke-RestMethod -WebSession $session -Uri $url -Method Post -Headers $hdrs&lt;BR /&gt;&lt;BR /&gt;I'm getting a "403 message stating user has no rights"&lt;BR /&gt;&lt;BR /&gt;Invoke-RestMethod : {"code":403,"message":"User has no rights to access the resource"}&lt;BR /&gt;At line:14 char:1&lt;BR /&gt;+ Invoke-RestMethod -WebSession $session -Uri $url -Method Post -Header ...&lt;BR /&gt;&lt;BR /&gt;My user account has admin role on NPrinting so not sure what else to check?&lt;BR /&gt;We are running NPrinting May 2022 SR4 and Qlik Sense Enterprise Feb 2022&lt;BR /&gt;&lt;BR /&gt;Any ideas or suggestions appreciated&lt;BR /&gt;&lt;BR /&gt;Paul&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:14:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/NPrinting-API-newbie-question/m-p/1917478#M35719</guid>
      <dc:creator>sturmeyp</dc:creator>
      <dc:date>2024-11-15T22:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: NPrinting API newbie question</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/NPrinting-API-newbie-question/m-p/1917485#M35721</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/4796"&gt;@sturmeyp&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Check that you have added your 'origin qlik sense or qlikview server' to the trusted origins setting on the NP web console under &lt;I&gt;&lt;STRONG&gt;Admin&amp;gt;Settings&amp;gt;On Demand/Add Trusted Origin&lt;/STRONG&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;Check this and other points mentioned here:&lt;/P&gt;
&lt;UL&gt;
 &lt;LI&gt;&lt;A href="https://community.qlik.com/t5/Knowledge/NPrinting-API-Setup-Requirements/ta-p/1715507" target="_blank"&gt;https://community.qlik.com/t5/Knowledge/NPrinting-API-Setup-Requirements/ta-p/1715507&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Kind regards...&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 14:11:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/NPrinting-API-newbie-question/m-p/1917485#M35721</guid>
      <dc:creator>Frank_S</dc:creator>
      <dc:date>2022-04-12T14:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: NPrinting API newbie question</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/NPrinting-API-newbie-question/m-p/1917721#M35729</link>
      <description>&lt;P&gt;to follow up on Franks idea - the origin will be the machine you are trying to run your api call from&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 22:23:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/NPrinting-API-newbie-question/m-p/1917721#M35729</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2022-04-12T22:23:35Z</dc:date>
    </item>
  </channel>
</rss>

