<?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 QlikSense Engine API with Python requests lib in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/QlikSense-Engine-API-with-Python-requests-lib/m-p/1662664#M12077</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I've been trying for quite some time now to send requests to QlikSense engine without success.&lt;BR /&gt;I must say that &lt;STRONG&gt;using the Engine API explorer works great&lt;/STRONG&gt;, but I need the same functionality in a Python script.&lt;/P&gt;&lt;P&gt;The actions I need to be done are very specific:&lt;BR /&gt;1. Get a script from txt file (&lt;STRONG&gt;GetIncludeFileContent&lt;/STRONG&gt; method)&lt;BR /&gt;2. Choose an app (&lt;STRONG&gt;OpenDoc&lt;/STRONG&gt; method)&lt;BR /&gt;3. Set the script to the one we got from section no.1 (&lt;STRONG&gt;SetScript&lt;/STRONG&gt; method)&lt;/P&gt;&lt;P&gt;I have used the sample code from&amp;nbsp;&lt;A href="https://support.qlik.com/articles/000061628" target="_blank"&gt;https://support.qlik.com/articles/000061628&lt;/A&gt;, and it worked fine:&lt;BR /&gt;I did get all my apps list - &lt;STRONG&gt;but any request I'm sending, I'm still getting a response with the app list.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;These are the sample headers:&lt;BR /&gt;headers = {'X-Qlik-xrfkey': xrf,&lt;BR /&gt;"Content-Type": "application/json",&lt;BR /&gt;"User-Agent":"Windows"}&lt;/P&gt;&lt;P&gt;res = requests.get(url,headers = headers,verify=False,auth=user_auth)&lt;/P&gt;&lt;P&gt;If I want to addthis:&lt;BR /&gt;{&lt;BR /&gt;"method": "OpenDoc",&lt;BR /&gt;"handle": -1,&lt;BR /&gt;"params": [&lt;BR /&gt;"app_id_example123456"&lt;BR /&gt;],&lt;BR /&gt;"outKey": -1,&lt;BR /&gt;"id": 2&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;How can I add this to the request?&lt;BR /&gt;Are all these methods (GetIncludeFileContent,&amp;nbsp;OpenDoc, SetScript) should use "GET" ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone has a Python script to share - it would be great!&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 03:40:42 GMT</pubDate>
    <dc:creator>hsonnino</dc:creator>
    <dc:date>2024-11-16T03:40:42Z</dc:date>
    <item>
      <title>QlikSense Engine API with Python requests lib</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QlikSense-Engine-API-with-Python-requests-lib/m-p/1662664#M12077</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I've been trying for quite some time now to send requests to QlikSense engine without success.&lt;BR /&gt;I must say that &lt;STRONG&gt;using the Engine API explorer works great&lt;/STRONG&gt;, but I need the same functionality in a Python script.&lt;/P&gt;&lt;P&gt;The actions I need to be done are very specific:&lt;BR /&gt;1. Get a script from txt file (&lt;STRONG&gt;GetIncludeFileContent&lt;/STRONG&gt; method)&lt;BR /&gt;2. Choose an app (&lt;STRONG&gt;OpenDoc&lt;/STRONG&gt; method)&lt;BR /&gt;3. Set the script to the one we got from section no.1 (&lt;STRONG&gt;SetScript&lt;/STRONG&gt; method)&lt;/P&gt;&lt;P&gt;I have used the sample code from&amp;nbsp;&lt;A href="https://support.qlik.com/articles/000061628" target="_blank"&gt;https://support.qlik.com/articles/000061628&lt;/A&gt;, and it worked fine:&lt;BR /&gt;I did get all my apps list - &lt;STRONG&gt;but any request I'm sending, I'm still getting a response with the app list.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;These are the sample headers:&lt;BR /&gt;headers = {'X-Qlik-xrfkey': xrf,&lt;BR /&gt;"Content-Type": "application/json",&lt;BR /&gt;"User-Agent":"Windows"}&lt;/P&gt;&lt;P&gt;res = requests.get(url,headers = headers,verify=False,auth=user_auth)&lt;/P&gt;&lt;P&gt;If I want to addthis:&lt;BR /&gt;{&lt;BR /&gt;"method": "OpenDoc",&lt;BR /&gt;"handle": -1,&lt;BR /&gt;"params": [&lt;BR /&gt;"app_id_example123456"&lt;BR /&gt;],&lt;BR /&gt;"outKey": -1,&lt;BR /&gt;"id": 2&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;How can I add this to the request?&lt;BR /&gt;Are all these methods (GetIncludeFileContent,&amp;nbsp;OpenDoc, SetScript) should use "GET" ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone has a Python script to share - it would be great!&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:40:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QlikSense-Engine-API-with-Python-requests-lib/m-p/1662664#M12077</guid>
      <dc:creator>hsonnino</dc:creator>
      <dc:date>2024-11-16T03:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: QlikSense Engine API with Python requests lib</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QlikSense-Engine-API-with-Python-requests-lib/m-p/1663038#M12078</link>
      <description>&lt;P&gt;The following works for me; you should be able to adapt it to your needs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import websocket&lt;BR /&gt;import ssl&lt;BR /&gt;import json&lt;/P&gt;&lt;P&gt;header_user = {'header_user': 'user1'}&lt;/P&gt;&lt;P&gt;ws = websocket.create_connection("ws://localhost:4848/app/", header=header_user)&lt;/P&gt;&lt;P&gt;print("connect")&lt;BR /&gt;print(ws.recv())&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ws.send(json.dumps({&lt;BR /&gt;"jsonrpc": "2.0",&lt;BR /&gt;"id": 1,&lt;BR /&gt;"method": "GetDocList",&lt;BR /&gt;"handle": -1,&lt;BR /&gt;"params": []&lt;BR /&gt;}))&lt;/P&gt;&lt;P&gt;print("receiving list")&lt;BR /&gt;print(ws.recv())&lt;/P&gt;&lt;P&gt;ws.send(json.dumps({&lt;BR /&gt;"method": "OpenDoc",&lt;BR /&gt;"handle": -1,&lt;BR /&gt;"params": [&lt;BR /&gt;"C:\\Users\\AndreonL\\Documents\\Qlik\\Sense\\Apps\\AgingTable.qvf"&lt;BR /&gt;],&lt;BR /&gt;"outKey": -1,&lt;BR /&gt;"id": 2&lt;BR /&gt;}))&lt;/P&gt;&lt;P&gt;print("open doc")&lt;BR /&gt;print(ws.recv())&lt;/P&gt;&lt;P&gt;ws.send(json.dumps({&lt;BR /&gt;"handle": 1,&lt;BR /&gt;"method": "GetScript",&lt;BR /&gt;"params": {},&lt;BR /&gt;"outKey": -1,&lt;BR /&gt;"id": 3&lt;BR /&gt;}))&lt;/P&gt;&lt;P&gt;print("get script")&lt;BR /&gt;print(ws.recv())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ws.close()&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 17:27:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QlikSense-Engine-API-with-Python-requests-lib/m-p/1663038#M12078</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2020-01-06T17:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: QlikSense Engine API with Python requests lib</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QlikSense-Engine-API-with-Python-requests-lib/m-p/1732609#M13075</link>
      <description>&lt;P&gt;When running the last "GetScript" thing. I get the below error. Any idea why?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;{"jsonrpc":"2.0","id":4,"error":{"code":-32602,"parameter":"Invalid handle","message":"Invalid Params"}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 20:36:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QlikSense-Engine-API-with-Python-requests-lib/m-p/1732609#M13075</guid>
      <dc:creator>niraj8241</dc:creator>
      <dc:date>2020-08-01T20:36:29Z</dc:date>
    </item>
  </channel>
</rss>

