<?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: Start with Qlik Engine API in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940392#M3414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok Alexander, that works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I want to execute an action that is a little bit harder.&lt;/P&gt;&lt;P&gt;The createapp function has clear parameters, but the createdimension hasn't clear dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to add a master item.&lt;/P&gt;&lt;P&gt;I.e. a dimension Coutry:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14417038840891916 jive_text_macro" jivemacro_uid="_14417038840891916" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js" rel="nofollow"&gt;https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; qsocks.Connect().then(function(global) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Connected'&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //Open document Sales Discovery&lt;/P&gt;
&lt;P&gt;&amp;nbsp; global.openDoc('QlikSense Intro.qvf').then(function(app) {&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; global.createDimension('Country').then(function(reply) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Dimension has been created ' + JSON.stringify(reply)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }, function(error) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Failed to create dimension ' + JSON.stringify(error)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }, function(error) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Failed to connect to Application ' + JSON.stringify(error)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }, function(error) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Failed to connect to Qlik Sense Desktop ' + JSON.stringify(error)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work this way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you bring me back an track?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tnx, Halmar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Sep 2015 09:23:37 GMT</pubDate>
    <dc:creator>qlikhalmar</dc:creator>
    <dc:date>2015-09-08T09:23:37Z</dc:date>
    <item>
      <title>Start with Qlik Engine API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940390#M3412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Qlik Engine API part of the help site is very usefull, but I miss the part before the start....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I create the basic HTML-file where I can add the functions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started with the easy one: Create a new QVF-file, using qsocks:&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14410262627819713" jivemacro_uid="_14410262627819713" modifiedtitle="true"&gt;
&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&amp;nbsp; &amp;lt;meta charset="utf-8" /&amp;gt; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;title&amp;gt;CreateAppTest&amp;lt;/title&amp;gt; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js" rel="nofollow"&gt;https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; qsocks.Connect().then(function(global) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(global)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "jsonrpc": "2.0",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "id": 0,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "method": "CreateApp",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "handle": -1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "params": [&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "CreateNewAppTest.qvf"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ]&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I saved it as a HTML-file and opened it in Chrome.....and nothing happened, what do I miss or what am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Halmar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 13:08:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940390#M3412</guid>
      <dc:creator>qlikhalmar</dc:creator>
      <dc:date>2015-08-31T13:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Start with Qlik Engine API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940391#M3413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Halmar,&lt;/P&gt;&lt;P&gt;So, just to get the terminology correct. The Engine API (Built by Qlik) is our communication protocol that follows the JSON RPC specification. Meaning the Engine API can be used in every programming language that supports sockets and json.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;qsocks (Not a Qlik product) is a javascript implementation of the Engine API that adds a promise layer on top of the calls back and forth with the engine. You can find more examples and documentation at &lt;A href="https://github.com/mindspank/qsocks" title="https://github.com/mindspank/qsocks"&gt;mindspank/qsocks · GitHub&lt;/A&gt; even though all the methods will be the same as the Engine API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your case you would never actually construct the JSON message the is sent to the Engine, qsocks will take care of that for you. You would just call the methods on the scope/context/class you are operating on and pass whatever parameters the method requires.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is for example a working example that will connect to Qlik Sense Desktop and create a app.&lt;BR /&gt;It's verbose but should get you started, will also run without a web a server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14410311903319251 jive_text_macro" jivemacro_uid="_14410311903319251"&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js" rel="nofollow"&gt;https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; qsocks.Connect().then(function(global) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Connected'&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // We now have access to the global class. See the documentation here for available methods&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; // &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/EngineAPI/Content/Classes/GlobalClass/Global-class.htm" rel="nofollow"&gt;https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/EngineAPI/Content/Classes/GlobalClass/Global-class.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; global.createApp('QlikCommunityTest.qvf').then(function(reply) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'App has been created ' + JSON.stringify(reply)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }, function(error) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Failed to create app ' + JSON.stringify(error)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }, function(error) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; document.body.innerText = 'Failed to connect to Qlik Sense Desktop ' + JSON.stringify(error)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 14:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940391#M3413</guid>
      <dc:creator>Alexander_Thor</dc:creator>
      <dc:date>2015-08-31T14:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Start with Qlik Engine API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940392#M3414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok Alexander, that works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I want to execute an action that is a little bit harder.&lt;/P&gt;&lt;P&gt;The createapp function has clear parameters, but the createdimension hasn't clear dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to add a master item.&lt;/P&gt;&lt;P&gt;I.e. a dimension Coutry:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14417038840891916 jive_text_macro" jivemacro_uid="_14417038840891916" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js" rel="nofollow"&gt;https://rawgit.com/mindspank/qsocks/master/qsocks.bundle.js&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; qsocks.Connect().then(function(global) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Connected'&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //Open document Sales Discovery&lt;/P&gt;
&lt;P&gt;&amp;nbsp; global.openDoc('QlikSense Intro.qvf').then(function(app) {&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; global.createDimension('Country').then(function(reply) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Dimension has been created ' + JSON.stringify(reply)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }, function(error) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Failed to create dimension ' + JSON.stringify(error)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }, function(error) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Failed to connect to Application ' + JSON.stringify(error)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }, function(error) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; document.body.innerText = 'Failed to connect to Qlik Sense Desktop ' + JSON.stringify(error)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work this way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you bring me back an track?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tnx, Halmar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 09:23:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940392#M3414</guid>
      <dc:creator>qlikhalmar</dc:creator>
      <dc:date>2015-09-08T09:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Start with Qlik Engine API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940393#M3415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hey,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;You can find the documentation for CreateDimension here, &lt;A href="https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/EngineAPI/Content/Classes/AppClass/App-class-CreateDimension-method.htm" title="https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/EngineAPI/Content/Classes/AppClass/App-class-CreateDimension-method.htm"&gt;https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/EngineAPI/Content/Classes/AppClass/App-class-CreateDimension-…&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;You'll notice that createDimension is a method on the App class so it's not something you can invoke from the global class. So when you call global.openDoc() it will return a handle to the app that was opened, this corresponds to the app class. Similarly when you call app.createDimension() it will return a handle/class to that genericDimension so you can invoke methods against the dimension if you would like.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I put up a gist here that shows how you create a dimension &lt;A href="https://gist.github.com/mindspank/474fee90c19ca9bff37e" title="https://gist.github.com/mindspank/474fee90c19ca9bff37e"&gt;createdimension.js · GitHub&lt;/A&gt; it uses node but the same code would work in the browser just remove the require part of course &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that sample you will notice that I set a few properties that are not prefixed with q, these are dynamic properties that our engine does not care about but our client uses to render the information from the engine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 15:02:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Start-with-Qlik-Engine-API/m-p/940393#M3415</guid>
      <dc:creator>Alexander_Thor</dc:creator>
      <dc:date>2015-09-08T15:02:01Z</dc:date>
    </item>
  </channel>
</rss>

