<?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>article Qlik Sense: Call Session API with Postman/PowerShell in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Sense-Call-Session-API-with-Postman-PowerShell/ta-p/1716992</link>
    <description>&lt;P&gt;This article explains how the session API works and the workflow.&lt;BR /&gt;Postman is used to perform the API call to add the session in Qlik Sense.&lt;BR /&gt;In the browser, developer tools or an extension can be used to set the cookie.&lt;/P&gt;
&lt;H3&gt;Authentication workflow&lt;/H3&gt;
&lt;P&gt;1. User authenticate to an external session module (This module must be built by the customer)&lt;BR /&gt;2. The module adds the session to the Proxy using the session API&lt;BR /&gt;3. The module sets the cookie for the end user&lt;BR /&gt;4. The end user is recognized as authenticated and can access the hub and apps.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Virtual Proxy settings:&lt;/H3&gt;
&lt;P&gt;It does not matter which authentication method is set on the virtual proxy as we are creating directly a session when using this method. However, the following information: &lt;STRONG&gt;Session Cookie header name&lt;/STRONG&gt;, &lt;STRONG&gt;Authentication module redirect URI&lt;/STRONG&gt; and &lt;STRONG&gt;Session Cookie&lt;/STRONG&gt; domain are important to remember when you use the Session API.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XND8&amp;amp;oid=00D20000000IGPX&amp;amp;lastMod=1547817027000" border="0" alt="User-added image" /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Add the session:&lt;/H3&gt;
&lt;P&gt;You will need to have the QlikClient certificate installed for the user performing this API call. More information is available in following articles:&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Support-Knowledge-Base/QRS-API-using-Xrfkey-header-in-Postman-Chrome-Extension/ta-p/1714661" target="_blank" rel="noopener"&gt;QRS API using Xrfkey header in Postman&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Support-Knowledge-Base/Export-client-certificate-and-root-certificate-to-make-API-calls/ta-p/1715515" target="_blank" rel="noopener"&gt;Export client certificate and root certificate to make API calls with Postman&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;In order to add a session to the virtual proxy, you need to provide the following information:&lt;BR /&gt;UserDirectory&lt;BR /&gt;UserId&lt;BR /&gt;Attributes (optional, these are for example groups to which the user belongs to)&lt;BR /&gt;Cookie value (In Qlik Sense by default, a 36 characters string such as aa051074-13a1-4f2a-842b-a64aa4d21001 is used, however this can be any value, but it must be long enough and randomized to ensure there is not 2 session cookies with the same value that are added to the virtual proxy)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Example of API call:&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="https://qlikserver1.domain.local:4243/qps/{virtual" target="_blank" rel="noopener"&gt;https://qlikserver1.domain.local:4243/qps/{virtual&lt;/A&gt; proxy prefix}/session?xrfkey=0123456789abcdef&lt;BR /&gt;&lt;BR /&gt;Headers:&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;X-Qlik-xrfkey&lt;/TD&gt;
&lt;TD&gt;0123456789abcdef&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Content-Type&lt;/TD&gt;
&lt;TD&gt;application/json&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;Body:&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; "UserDirectory": "DOMAIN",&lt;BR /&gt;&amp;nbsp; "UserId": "User1",&lt;BR /&gt;&amp;nbsp; "Attributes":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; [],&lt;BR /&gt;&amp;nbsp; "SessionId": "aa051074-13a1-4f2a-842b-a64aa4d21001"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Postman:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XNDD&amp;amp;oid=00D20000000IGPX&amp;amp;lastMod=1547817036000" border="0" alt="User-added image" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;PowerShell:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;$body = '{
  "UserDirectory": "DOMAIN",
  "UserId": "User1",
  "Attributes":
    [],
  "SessionId": "aa051074-13a1-4f2a-842b-a64aa4d21001"
}'
   $hdrs = @{}
   $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB")
   $url = "https://qlikserver1.domain.local:4243/qps/session?xrfkey=iX83QmNlvu87yyAB"
   $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
   Invoke-RestMethod -Uri $url -Method Post -Body $body -ContentType 'application/json' -Headers $hdrs -Certificate $cert&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Set the cookie:&lt;/H3&gt;
&lt;P&gt;&lt;BR /&gt;In Chrome, an extension such as "EditThisCookie" can be used to test that the session API works.&lt;BR /&gt;&lt;BR /&gt;Open the hub and add a cookie with the following information:&lt;BR /&gt;&lt;BR /&gt;Name: X-Qlik-Session-sessionvp&lt;BR /&gt;Value: aa051074-13a1-4f2a-842b-a64aa4d21001&lt;BR /&gt;Domain: domain.local&lt;BR /&gt;Expiration: 0001-01-01 00:00:00&lt;BR /&gt;HttpOnly:True&lt;BR /&gt;Secure:True&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XNDI&amp;amp;oid=00D20000000IGPX&amp;amp;lastMod=1547817046000" border="0" alt="User-added image" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Save the cookie and refresh the page, make sure the address is&amp;nbsp;&lt;A href="https://qlikserver1.domain.local/{virtual" target="_blank" rel="noopener"&gt;https://qlikserver1.domain.local/{virtual&lt;/A&gt; proxy prefix}/hub/ when you refresh.&lt;BR /&gt;&lt;BR /&gt;Now you should be logged in as the user requested in the previous API call and able to access the hub/your apps.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2023 09:04:45 GMT</pubDate>
    <dc:creator>Damien_V</dc:creator>
    <dc:date>2023-03-03T09:04:45Z</dc:date>
    <item>
      <title>Qlik Sense: Call Session API with Postman/PowerShell</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Sense-Call-Session-API-with-Postman-PowerShell/ta-p/1716992</link>
      <description>&lt;P&gt;This article explains how the session API works and the workflow.&lt;BR /&gt;Postman is used to perform the API call to add the session in Qlik Sense.&lt;BR /&gt;In the browser, developer tools or an extension can be used to set the cookie.&lt;/P&gt;
&lt;H3&gt;Authentication workflow&lt;/H3&gt;
&lt;P&gt;1. User authenticate to an external session module (This module must be built by the customer)&lt;BR /&gt;2. The module adds the session to the Proxy using the session API&lt;BR /&gt;3. The module sets the cookie for the end user&lt;BR /&gt;4. The end user is recognized as authenticated and can access the hub and apps.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Virtual Proxy settings:&lt;/H3&gt;
&lt;P&gt;It does not matter which authentication method is set on the virtual proxy as we are creating directly a session when using this method. However, the following information: &lt;STRONG&gt;Session Cookie header name&lt;/STRONG&gt;, &lt;STRONG&gt;Authentication module redirect URI&lt;/STRONG&gt; and &lt;STRONG&gt;Session Cookie&lt;/STRONG&gt; domain are important to remember when you use the Session API.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XND8&amp;amp;oid=00D20000000IGPX&amp;amp;lastMod=1547817027000" border="0" alt="User-added image" /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Add the session:&lt;/H3&gt;
&lt;P&gt;You will need to have the QlikClient certificate installed for the user performing this API call. More information is available in following articles:&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Support-Knowledge-Base/QRS-API-using-Xrfkey-header-in-Postman-Chrome-Extension/ta-p/1714661" target="_blank" rel="noopener"&gt;QRS API using Xrfkey header in Postman&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Support-Knowledge-Base/Export-client-certificate-and-root-certificate-to-make-API-calls/ta-p/1715515" target="_blank" rel="noopener"&gt;Export client certificate and root certificate to make API calls with Postman&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;In order to add a session to the virtual proxy, you need to provide the following information:&lt;BR /&gt;UserDirectory&lt;BR /&gt;UserId&lt;BR /&gt;Attributes (optional, these are for example groups to which the user belongs to)&lt;BR /&gt;Cookie value (In Qlik Sense by default, a 36 characters string such as aa051074-13a1-4f2a-842b-a64aa4d21001 is used, however this can be any value, but it must be long enough and randomized to ensure there is not 2 session cookies with the same value that are added to the virtual proxy)&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Example of API call:&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="https://qlikserver1.domain.local:4243/qps/{virtual" target="_blank" rel="noopener"&gt;https://qlikserver1.domain.local:4243/qps/{virtual&lt;/A&gt; proxy prefix}/session?xrfkey=0123456789abcdef&lt;BR /&gt;&lt;BR /&gt;Headers:&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;X-Qlik-xrfkey&lt;/TD&gt;
&lt;TD&gt;0123456789abcdef&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Content-Type&lt;/TD&gt;
&lt;TD&gt;application/json&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;Body:&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; "UserDirectory": "DOMAIN",&lt;BR /&gt;&amp;nbsp; "UserId": "User1",&lt;BR /&gt;&amp;nbsp; "Attributes":&lt;BR /&gt;&amp;nbsp; &amp;nbsp; [],&lt;BR /&gt;&amp;nbsp; "SessionId": "aa051074-13a1-4f2a-842b-a64aa4d21001"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Postman:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XNDD&amp;amp;oid=00D20000000IGPX&amp;amp;lastMod=1547817036000" border="0" alt="User-added image" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;PowerShell:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;$body = '{
  "UserDirectory": "DOMAIN",
  "UserId": "User1",
  "Attributes":
    [],
  "SessionId": "aa051074-13a1-4f2a-842b-a64aa4d21001"
}'
   $hdrs = @{}
   $hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB")
   $url = "https://qlikserver1.domain.local:4243/qps/session?xrfkey=iX83QmNlvu87yyAB"
   $cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
   Invoke-RestMethod -Uri $url -Method Post -Body $body -ContentType 'application/json' -Headers $hdrs -Certificate $cert&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Set the cookie:&lt;/H3&gt;
&lt;P&gt;&lt;BR /&gt;In Chrome, an extension such as "EditThisCookie" can be used to test that the session API works.&lt;BR /&gt;&lt;BR /&gt;Open the hub and add a cookie with the following information:&lt;BR /&gt;&lt;BR /&gt;Name: X-Qlik-Session-sessionvp&lt;BR /&gt;Value: aa051074-13a1-4f2a-842b-a64aa4d21001&lt;BR /&gt;Domain: domain.local&lt;BR /&gt;Expiration: 0001-01-01 00:00:00&lt;BR /&gt;HttpOnly:True&lt;BR /&gt;Secure:True&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000005XNDI&amp;amp;oid=00D20000000IGPX&amp;amp;lastMod=1547817046000" border="0" alt="User-added image" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Save the cookie and refresh the page, make sure the address is&amp;nbsp;&lt;A href="https://qlikserver1.domain.local/{virtual" target="_blank" rel="noopener"&gt;https://qlikserver1.domain.local/{virtual&lt;/A&gt; proxy prefix}/hub/ when you refresh.&lt;BR /&gt;&lt;BR /&gt;Now you should be logged in as the user requested in the previous API call and able to access the hub/your apps.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 09:04:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Sense-Call-Session-API-with-Postman-PowerShell/ta-p/1716992</guid>
      <dc:creator>Damien_V</dc:creator>
      <dc:date>2023-03-03T09:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Call Session API with Postman/PowerShell</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Sense-Call-Session-API-with-Postman-PowerShell/tac-p/2518487#M15816</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Thank you for these clarifications.&lt;BR /&gt;I would like to automate the table export of a qlik view in data format via a powershell script using the REST API.&lt;BR /&gt;I can't connect to the API with my powershell script.&lt;BR /&gt;Can you give us more details on :&lt;BR /&gt;1. external session module: is it possible to retrieve the Cookie generated during the connection via the script?&lt;BR /&gt;2. Virtual proxy settings: which elements are mandatory and in what format, with specific examples of fields&lt;BR /&gt;3. Where should this X-Qlik-xrfkey field be defined?&lt;BR /&gt;Many thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 13:07:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Sense-Call-Session-API-with-Postman-PowerShell/tac-p/2518487#M15816</guid>
      <dc:creator>lea_ternat</dc:creator>
      <dc:date>2025-05-21T13:07:20Z</dc:date>
    </item>
  </channel>
</rss>

