<?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: Newbie using Qlik API JSON in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564750#M10280</link>
    <description>Id should probably not be zero, abd it looks like a comma is missing after&lt;BR /&gt;tje zero.&lt;BR /&gt;</description>
    <pubDate>Wed, 03 Apr 2019 17:07:58 GMT</pubDate>
    <dc:creator>ErikWetterberg</dc:creator>
    <dc:date>2019-04-03T17:07:58Z</dc:date>
    <item>
      <title>Newbie using Qlik API JSON</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564505#M10275</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to learn how to pull data from the Qlik-Sense APi (I'm using just the desktop client, no server).&lt;/P&gt;&lt;P&gt;I've created the WebSocket and a variable&amp;nbsp;myOpenDocObj to hold my OpenDoc Method.&lt;/P&gt;&lt;P&gt;How do I actually send this OpenDoc message to the API and then how do I get back a response ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated (I know this must be very basic stuff for most people on here!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;h2&amp;gt;This is a test.&amp;lt;/h2&amp;gt;

&amp;lt;p id="demo"&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;script&amp;gt;
var ws = new WebSocket("ws://localhost:4848/app/");

var myOpenDocObj = 
	{
		"method": "OpenDoc",
		"handle": -1,
		"params": [
			"C:\\Users\\Simon\\Documents\\Qlik\\Sense\\Apps\\Consumer Sales.qvf"
		],
		"outKey": -1,
		"id": 2
	};

	
&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:10:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564505#M10275</guid>
      <dc:creator>RedSky001</dc:creator>
      <dc:date>2024-11-16T06:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie using Qlik API JSON</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564527#M10276</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;ws.send(message) is the method to use. Check the specification here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/WebSocket" target="_blank"&gt;https://developer.mozilla.org/en-US/docs/Web/API/WebSocket&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To handle the reply you need an eventlistener for the message event. An example is on the same page.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 12:14:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564527#M10276</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2019-04-03T12:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie using Qlik API JSON</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564563#M10277</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp; I've made some progress now (I'm sending and receiving a response).&amp;nbsp; However I'm getting an 'invalid request'.&lt;/P&gt;&lt;P&gt;Do you have any idea what I could be doing wrong?&lt;/P&gt;&lt;P&gt;(Thanks again)&lt;/P&gt;&lt;P&gt;Message from server {"jsonrpc":"2.0","method":"OnConnected","params":{"qSessionState":"SESSION_CREATED"}}&lt;BR /&gt;(index):37&lt;/P&gt;&lt;P&gt;Message from server {"jsonrpc":"2.0","id":0,"error":{"code":-32600,"parameter":"Request processing error","message":"Invalid Request"}}&lt;/P&gt;&lt;PRE&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;h2&amp;gt;This is a test.&amp;lt;/h2&amp;gt;

&amp;lt;p id="demo"&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;script&amp;gt;

var myOpenDocObj = 
{
	"method": "OpenDoc",
	"handle": -1,
	"params": [
		"C:\\Users\\Simon\\Documents\\Qlik\\Sense\\Apps\\Consumer Sales.qvf"
	],
	"outKey": -1,
	"id": 2
}

// Create WebSocket connection.
const socket = new WebSocket('ws://localhost:4848/app/');

// Connection opened
socket.addEventListener('open', function (event) {
    socket.send(myOpenDocObj);
});

// Listen for messages
socket.addEventListener('message', function (event) {
    console.log('Message from server ', event.data);
});


&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Apr 2019 12:48:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564563#M10277</guid>
      <dc:creator>RedSky001</dc:creator>
      <dc:date>2019-04-03T12:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie using Qlik API JSON</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564605#M10278</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You probably need to include&lt;/P&gt;&lt;P&gt;jsonrpc: "2.0"&lt;/P&gt;&lt;P&gt;and I don't know about the outkey.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 13:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564605#M10278</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2019-04-03T13:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie using Qlik API JSON</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564712#M10279</link>
      <description>&lt;P&gt;Didn't help unfortunately.&lt;/P&gt;&lt;P&gt;I'm now using the exact example Qlik suggest on their webpage:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense-developer/February2019/Subsystems/EngineAPI/Content/Sense_EngineAPI/GettingStarted/connecting-to-engine-api.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense-developer/February2019/Subsystems/EngineAPI/Content/Sense_EngineAPI/GettingStarted/connecting-to-engine-api.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So I'm passing this JSON string and still getting an 'invalid request' message.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;{&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"jsonrpc"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"2.0"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"id"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"handle"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"method"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"GetDocList"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"params"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 16:04:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564712#M10279</guid>
      <dc:creator>RedSky001</dc:creator>
      <dc:date>2019-04-03T16:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie using Qlik API JSON</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564750#M10280</link>
      <description>Id should probably not be zero, abd it looks like a comma is missing after&lt;BR /&gt;tje zero.&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Apr 2019 17:07:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Newbie-using-Qlik-API-JSON/m-p/1564750#M10280</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2019-04-03T17:07:58Z</dc:date>
    </item>
  </channel>
</rss>

