<?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 Uploading/Publishing Qlik Objects to Hub through Enigma.js in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Uploading-Publishing-Qlik-Objects-to-Hub-through-Enigma-js/m-p/1997269#M17463</link>
    <description>&lt;DIV class="votecell post-layout--left"&gt;
&lt;DIV class="js-voting-container d-flex jc-center fd-column ai-stretch gs4 fc-black-200" data-post-id="74212777"&gt;
&lt;DIV class="js-vote-count flex--item d-flex fd-column ai-center fc-black-500 fs-title" data-value="0"&gt;Hello,&lt;/DIV&gt;
&lt;BUTTON class="js-vote-down-btn flex--item s-btn s-btn__unset c-pointer " data-controller="s-tooltip" data-s-tooltip-placement="right" aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary" data-unselected-classes="" aria-describedby="--stacks-s-tooltip-m7zt4p6b"&gt;&lt;/BUTTON&gt;&lt;BUTTON id="saves-btn-74212777" class="js-saves-btn s-btn s-btn__unset c-pointer py4" data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-popover-placement="" aria-pressed="false" data-post-id="74212777" data-post-type-id="1" data-user-privilege-for-post-click="-1" aria-controls="" data-s-popover-auto-show="false" aria-describedby="--stacks-s-tooltip-t1kjkbla"&gt;&lt;/BUTTON&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="postcell post-layout--right"&gt;
&lt;DIV class="s-prose js-post-body"&gt;
&lt;P&gt;I am currently trying to figure out a way to publish objects (charts/tables/variables/dimensions/etc) to the Qlik Hub from an application. I've been using Javascript, Enigma.js, and have been hosting the application on the same machine as the Qlik server as a mashup extension.&lt;/P&gt;
&lt;P&gt;I've noticed there is a method called createObject() in the Engima.js API for use upon Generic Objects in Qlik, but I have working, but only creates objects locally (in application memory, not persistent, not in the hub). If I try to call the publish() method on that object, I receive a 'Bad Request' error.&lt;/P&gt;
&lt;P&gt;This is the repo for Engima.js:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/qlik-oss/enigma.js" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/qlik-oss/enigma.js&lt;/A&gt;. And the API schema:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/qlik-oss/enigma.js/blob/master/schemas/12.1477.0.json" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/qlik-oss/enigma.js/blob/master/schemas/12.1477.0.json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Pretty stuck, any help would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Matt&lt;/P&gt;
&lt;P&gt;I've tried using the createObject() method:&lt;/P&gt;
&lt;PRE class="lang-js s-code-block"&gt;&lt;CODE class="hljs language-javascript"&gt;&lt;SPAN class="hljs-string"&gt;"CreateObject"&lt;/SPAN&gt;: {
                &lt;SPAN class="hljs-string"&gt;"In"&lt;/SPAN&gt;: [{ &lt;SPAN class="hljs-string"&gt;"Name"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"qProp"&lt;/SPAN&gt;,&lt;SPAN class="hljs-string"&gt;"DefaultValue"&lt;/SPAN&gt;: {&lt;SPAN class="hljs-string"&gt;"qInfo"&lt;/SPAN&gt;: {&lt;SPAN class="hljs-string"&gt;"qId"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;""&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"qType"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;""&lt;/SPAN&gt;}, &lt;SPAN class="hljs-string"&gt;"qExtendsId"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;""&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"qMetaDef"&lt;/SPAN&gt;: {}, &lt;SPAN class="hljs-string"&gt;"qStateName"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;""&lt;/SPAN&gt;} }],
                &lt;SPAN class="hljs-string"&gt;"Out"&lt;/SPAN&gt;: [{ &lt;SPAN class="hljs-string"&gt;"Name"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"qInfo"&lt;/SPAN&gt; }]
            }
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE&gt;in tandem with publish() which is for Generic Objects in Qlik:&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE class="lang-js s-code-block"&gt;&lt;CODE class="hljs language-javascript"&gt;&lt;SPAN class="hljs-string"&gt;"Publish"&lt;/SPAN&gt;: {
                &lt;SPAN class="hljs-string"&gt;"In"&lt;/SPAN&gt;: [],
                &lt;SPAN class="hljs-string"&gt;"Out"&lt;/SPAN&gt;: []
            }
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But receive a Bad Request error.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 26 Oct 2022 18:53:24 GMT</pubDate>
    <dc:creator>mklaczak</dc:creator>
    <dc:date>2022-10-26T18:53:24Z</dc:date>
    <item>
      <title>Uploading/Publishing Qlik Objects to Hub through Enigma.js</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Uploading-Publishing-Qlik-Objects-to-Hub-through-Enigma-js/m-p/1997269#M17463</link>
      <description>&lt;DIV class="votecell post-layout--left"&gt;
&lt;DIV class="js-voting-container d-flex jc-center fd-column ai-stretch gs4 fc-black-200" data-post-id="74212777"&gt;
&lt;DIV class="js-vote-count flex--item d-flex fd-column ai-center fc-black-500 fs-title" data-value="0"&gt;Hello,&lt;/DIV&gt;
&lt;BUTTON class="js-vote-down-btn flex--item s-btn s-btn__unset c-pointer " data-controller="s-tooltip" data-s-tooltip-placement="right" aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary" data-unselected-classes="" aria-describedby="--stacks-s-tooltip-m7zt4p6b"&gt;&lt;/BUTTON&gt;&lt;BUTTON id="saves-btn-74212777" class="js-saves-btn s-btn s-btn__unset c-pointer py4" data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-popover-placement="" aria-pressed="false" data-post-id="74212777" data-post-type-id="1" data-user-privilege-for-post-click="-1" aria-controls="" data-s-popover-auto-show="false" aria-describedby="--stacks-s-tooltip-t1kjkbla"&gt;&lt;/BUTTON&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="postcell post-layout--right"&gt;
&lt;DIV class="s-prose js-post-body"&gt;
&lt;P&gt;I am currently trying to figure out a way to publish objects (charts/tables/variables/dimensions/etc) to the Qlik Hub from an application. I've been using Javascript, Enigma.js, and have been hosting the application on the same machine as the Qlik server as a mashup extension.&lt;/P&gt;
&lt;P&gt;I've noticed there is a method called createObject() in the Engima.js API for use upon Generic Objects in Qlik, but I have working, but only creates objects locally (in application memory, not persistent, not in the hub). If I try to call the publish() method on that object, I receive a 'Bad Request' error.&lt;/P&gt;
&lt;P&gt;This is the repo for Engima.js:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/qlik-oss/enigma.js" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/qlik-oss/enigma.js&lt;/A&gt;. And the API schema:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/qlik-oss/enigma.js/blob/master/schemas/12.1477.0.json" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/qlik-oss/enigma.js/blob/master/schemas/12.1477.0.json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Pretty stuck, any help would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Matt&lt;/P&gt;
&lt;P&gt;I've tried using the createObject() method:&lt;/P&gt;
&lt;PRE class="lang-js s-code-block"&gt;&lt;CODE class="hljs language-javascript"&gt;&lt;SPAN class="hljs-string"&gt;"CreateObject"&lt;/SPAN&gt;: {
                &lt;SPAN class="hljs-string"&gt;"In"&lt;/SPAN&gt;: [{ &lt;SPAN class="hljs-string"&gt;"Name"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"qProp"&lt;/SPAN&gt;,&lt;SPAN class="hljs-string"&gt;"DefaultValue"&lt;/SPAN&gt;: {&lt;SPAN class="hljs-string"&gt;"qInfo"&lt;/SPAN&gt;: {&lt;SPAN class="hljs-string"&gt;"qId"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;""&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"qType"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;""&lt;/SPAN&gt;}, &lt;SPAN class="hljs-string"&gt;"qExtendsId"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;""&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"qMetaDef"&lt;/SPAN&gt;: {}, &lt;SPAN class="hljs-string"&gt;"qStateName"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;""&lt;/SPAN&gt;} }],
                &lt;SPAN class="hljs-string"&gt;"Out"&lt;/SPAN&gt;: [{ &lt;SPAN class="hljs-string"&gt;"Name"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"qInfo"&lt;/SPAN&gt; }]
            }
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE&gt;in tandem with publish() which is for Generic Objects in Qlik:&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE class="lang-js s-code-block"&gt;&lt;CODE class="hljs language-javascript"&gt;&lt;SPAN class="hljs-string"&gt;"Publish"&lt;/SPAN&gt;: {
                &lt;SPAN class="hljs-string"&gt;"In"&lt;/SPAN&gt;: [],
                &lt;SPAN class="hljs-string"&gt;"Out"&lt;/SPAN&gt;: []
            }
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But receive a Bad Request error.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 26 Oct 2022 18:53:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Uploading-Publishing-Qlik-Objects-to-Hub-through-Enigma-js/m-p/1997269#M17463</guid>
      <dc:creator>mklaczak</dc:creator>
      <dc:date>2022-10-26T18:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading/Publishing Qlik Objects to Hub through Enigma.js</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Uploading-Publishing-Qlik-Objects-to-Hub-through-Enigma-js/m-p/2000729#M17489</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/185347"&gt;@mklaczak&lt;/a&gt;&amp;nbsp;, if with "publish object to Qlik hub" you mean to create visualizations directly into a Qlik Sense app using enigma.js, below you can find an approach using Engine APIs (you can use Engine API methods with enigma.js). Anyway, I'd like to know what is the use case, why you need to do this?&lt;/P&gt;&lt;P&gt;First you have to understand in which sheet you will create your visualization. Assume that we will create a bar chart in sheet "My new sheet" with a sheet id equal to:&amp;nbsp;&lt;EM&gt;ac33686c-8847-41f2-9e81-7b78fdb3210b.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;As first step, from &lt;EM&gt;doc&lt;/EM&gt; object (Qlik app in engine API) you have to get the sheet using GetObject method and passing sheet id:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"handle": 1,
	"method": "GetObject",
	"params": {
		"qId": "ac33686c-8847-41f2-9e81-7b78fdb3210b"
	},
	"outKey": -1,
	"id": 3
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;You will received the sheet object and now you can call methods on it.&lt;/P&gt;&lt;P&gt;From sheet object you have to call &lt;EM&gt;GetFullPropertyTree &lt;/EM&gt;method for getting the current sheet layout. Basically here you can understand which visualizations you have in sheet&amp;nbsp;(if they are present) and with which position they have (grid position)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"handle": 2,
	"method": "GetFullPropertyTree",
	"params": {},
	"outKey": -1,
	"id": 4,
	"return_empty": true,
	"delta": false
}&lt;/LI-CODE&gt;&lt;P&gt;Response from engine is the sheet layout. For keeping things simple, my sheet is an empty sheet, so under &lt;EM&gt;cells&lt;/EM&gt; and &lt;EM&gt;qChildren&lt;/EM&gt; nodes we have an empty array.&lt;/P&gt;&lt;P&gt;This will be your starting point for next call, indeed we will add to it new visualizations&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"jsonrpc": "2.0",
	"id": 5,
	"result": {
		"qPropEntry": {
			"qProperty": {
				"qInfo": {
					"qId": "ac33686c-8847-41f2-9e81-7b78fdb3210b",
					"qType": "sheet"
				},
				"qExtendsId": "",
				"qMetaDef": {
					"title": "My new sheet (3)",
					"description": ""
				},
				"qStateName": "",
				"rank": 6,
				"thumbnail": {
					"qStaticContentUrlDef": {
						"qUrl": ""
					}
				},
				"columns": 24,
				"rows": 12,
				"cells": [],
				"qChildListDef": {
					"qData": {
						"title": "/title"
					}
				},
				"gridResolution": "small",
				"layoutOptions": {
					"mobileLayout": "LIST"
				}
			},
			"qChildren": [],
			"qEmbeddedSnapshotRef": null
		}
	}
}&lt;/LI-CODE&gt;&lt;P&gt;Starting from above response now we will add a bar chart to the sheet using &lt;EM&gt;SetFullPropertyTree&amp;nbsp;&lt;/EM&gt;method. Basically we are adding bar chart adding information under &lt;EM&gt;cell&lt;/EM&gt; and &lt;EM&gt;qChildren&lt;/EM&gt; node.&lt;/P&gt;&lt;P&gt;Under &lt;EM&gt;cell&lt;/EM&gt; you have to define name (your random viz id), bounds (chart position in grid), colspan and rowspan (width and height cells in grid).&lt;/P&gt;&lt;P&gt;Under &lt;EM&gt;qChildren&lt;/EM&gt; you have to define barchart properties (dimensions, measures, reference lines, titles, subtitles, etc.)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"handle": 2,
	"method": "SetFullPropertyTree",
	"params": {
		"qPropEntry": {
			"qProperty": {
				"qInfo": {
					"qId": "ac33686c-8847-41f2-9e81-7b78fdb3210b",
					"qType": "sheet"
				},
				"qExtendsId": "",
				"qMetaDef": {
					"title": "My new sheet (3)",
					"description": ""
				},
				"qStateName": "",
				"rank": 6,
				"thumbnail": {
					"qStaticContentUrlDef": {
						"qUrl": ""
					}
				},
				"columns": 24,
				"rows": 12,
				"cells": [
					{
						"name": "abcdef",
						"type": "barchart",
						"col": 0,
						"row": 0,
						"colspan": 12,
						"rowspan": 6,
						"bounds": {
							"y": 0,
							"x": 0,
							"width": 50,
							"height": 50
						}
					}
				],
				"qChildListDef": {
					"qData": {
						"title": "/title"
					}
				},
				"gridResolution": "small",
				"layoutOptions": {
					"mobileLayout": "LIST"
				}
			},
			"qChildren": [
				{
					"qChildren": [],
					"qProperty": {
						"qHyperCubeDef": {
							"qDimensions": [],
							"qMeasures": [],
							"qSuppressZero": false,
							"qInitialDataFetch": [
								{
									"qWidth": 17,
									"qHeight": 500
								}
							],
							"qSuppressMissing": true
						},
						"refLine": {
							"refLines": [],
							"dimRefLines": []
						},
						"showTitles": true,
						"title": "",
						"subtitle": "",
						"footnote": "",
						"disableNavMenu": false,
						"showDetails": false,
						"showDisclaimer": true,
						"qStateName": "",
						"components": [],
						"barGrouping": {
							"grouping": "grouped"
						},
						"orientation": "vertical",
						"scrollbar": "miniChart",
						"scrollStartPos": 0,
						"gridLine": {
							"auto": true,
							"spacing": 2
						},
						"dataPoint": {
							"showLabels": false,
							"showSegmentLabels": false,
							"showTotalLabels": true
						},
						"color": {
							"auto": true,
							"mode": "primary",
							"formatting": {
								"numFormatFromTemplate": true
							},
							"useBaseColors": "off",
							"paletteColor": {
								"index": 6
							},
							"useDimColVal": true,
							"useMeasureGradient": true,
							"persistent": false,
							"expressionIsColor": true,
							"expressionLabel": "",
							"measureScheme": "sg",
							"reverseScheme": false,
							"dimensionScheme": "12",
							"autoMinMax": true,
							"measureMin": 0,
							"measureMax": 10
						},
						"legend": {
							"show": true,
							"dock": "auto",
							"showTitle": true
						},
						"dimensionAxis": {
							"continuousAuto": true,
							"show": "all",
							"label": "auto",
							"dock": "near",
							"axisDisplayMode": "auto",
							"maxVisibleItems": 10
						},
						"preferContinuousAxis": true,
						"measureAxis": {
							"show": "all",
							"dock": "near",
							"spacing": 1,
							"autoMinMax": true,
							"minMax": "min",
							"min": 0,
							"max": 10
						},
						"tooltip": {
							"auto": true,
							"hideBasic": false,
							"chart": {
								"style": {
									"size": "medium"
								}
							},
							"data": {}
						},
						"qInfo": {
							"qType": "barchart",
							"qId": "abcdef"
						},
						"visualization": "barchart",
						"version": "1.12.17",
						"showMiniChartForContinuousAxis": true
					}
				}
			],
			"qEmbeddedSnapshotRef": null
		}
	},
	"outKey": -1,
	"id": 10
}&lt;/LI-CODE&gt;&lt;P&gt;Engine response where you can understand that the chart is created&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"jsonrpc": "2.0",
	"id": 10,
	"delta": true,
	"result": {},
	"change": [
		2
	]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 14:16:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Uploading-Publishing-Qlik-Objects-to-Hub-through-Enigma-js/m-p/2000729#M17489</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2022-11-04T14:16:31Z</dc:date>
    </item>
  </channel>
</rss>

