<?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: QRS Integration with Powershell 2.0 in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-Integration-with-Powershell-2-0/m-p/1139559#M5383</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently have the same problem, got the POST command working in Postman. But cant get it to work in PS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you found a solution wet?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Teis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Aug 2016 14:30:13 GMT</pubDate>
    <dc:creator>teiswamsler</dc:creator>
    <dc:date>2016-08-29T14:30:13Z</dc:date>
    <item>
      <title>QRS Integration with Powershell 2.0</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-Integration-with-Powershell-2-0/m-p/1139558#M5382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to reload a task using QRS API integration. The idea is to call Powershell from a Qlikview Document so it reloads a QlikSense document after it finishes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am being able to reload by using Postman. Here is the Request.bin request:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;POST&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;{host}/qrs/task/{taskid}/start/synchronous?xrfkey=ABCDEFG123456789&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;QUERYSTRING:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;xrfkey: ABCDEFG123456789&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HEADERS:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;X-Qlik-Xrfkey: ABCDEFG123456789&lt;/P&gt;&lt;P&gt;Cf-Visitor: {"scheme":"http"}&lt;/P&gt;&lt;P&gt;Connection: close&lt;/P&gt;&lt;P&gt;Content-Type: application/x-www-form-urlencoded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am not being able to do this using Powershell v2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the documentation in Qlik Branch I saw this code that allows us to communicate using Powershell:&lt;/P&gt;&lt;P&gt;$req = New-Object System.Net.WebClient&lt;/P&gt;&lt;P&gt;$req.Credentials = [System.Net.CredentialCache]::DefaultCredentials&lt;/P&gt;&lt;P&gt;$req.QueryString.Add("xrfkey", "ABCDEFG123456789")&lt;/P&gt;&lt;P&gt;$req.Headers.Add("X-Qlik-xrfkey", "ABCDEFG123456789")&lt;/P&gt;&lt;P&gt;[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}&lt;/P&gt;&lt;P&gt;$req.Headers.Add("Cf-Visitor", ‘{"scheme":"http"}‘);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$req.DownloadString("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;{host}/qrs/task/{taskid}/start/synchronous"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is working, but as it is a GET request, it just downloads the URL, without reloading the task. I need to do a POST request.&lt;/P&gt;&lt;P&gt;I tried using the command Invoke-WebRequest, but is not available on this version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone no how can I do it without &lt;SPAN style="font-size: 13.3333px;"&gt;Invoke-WebRequest?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2016 11:00:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-Integration-with-Powershell-2-0/m-p/1139558#M5382</guid>
      <dc:creator>martinmichalski</dc:creator>
      <dc:date>2016-06-29T11:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: QRS Integration with Powershell 2.0</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-Integration-with-Powershell-2-0/m-p/1139559#M5383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently have the same problem, got the POST command working in Postman. But cant get it to work in PS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you found a solution wet?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Teis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 14:30:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-Integration-with-Powershell-2-0/m-p/1139559#M5383</guid>
      <dc:creator>teiswamsler</dc:creator>
      <dc:date>2016-08-29T14:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: QRS Integration with Powershell 2.0</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-Integration-with-Powershell-2-0/m-p/1139560#M5384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Teis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late reply. I discovered that Postman uses Windows Authentication method, so it works if you already had an opened session with the server (I believe it's enough by logging into the hub or the qmc). That's why you need to make a GET call before the POST, so you go through the authentication module.&lt;/P&gt;&lt;P&gt;However, if you use the server credentials by installing the windows client certificate in the machine that is executing the call you should be able to communicate with the API.&lt;/P&gt;&lt;P&gt;Then you can get the certificate with this command:&lt;/P&gt;&lt;P&gt;$cert = Get-Childitem cert:\CurrentUser\My\ | where { $_.subject -eq "CN=YourCertName" }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And include it in the request by ClientCertificates.Add:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$web = [System.Net.WebRequest]::Create($url)&lt;/P&gt;&lt;P&gt;$web.ClientCertificates.Add($cert)&lt;/P&gt;&lt;P&gt;$web.Method = "POST"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember you also need to add headers for the x-qlik-xrfkey: ABCDEFG123456789 and the X-Qlik-User: UserDirectory=Internal;UserId=sa_repository&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helped.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 09:36:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-Integration-with-Powershell-2-0/m-p/1139560#M5384</guid>
      <dc:creator>martinmichalski</dc:creator>
      <dc:date>2016-09-28T09:36:00Z</dc:date>
    </item>
  </channel>
</rss>

