<?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 Connect Qlik to API REST in Data Movement &amp; Streaming</title>
    <link>https://community.qlik.com/t5/Data-Movement-Streaming/Connect-Qlik-to-API-REST/m-p/2098473#M1288</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have the connection to the REST API, when trying to send the list X and Y in the body as a variable, it gives me an error that it does not recognize the input parameter that is being sent. Your help please.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When creating the connection, I put as parameters in RequestBody:&lt;BR /&gt;{&lt;BR /&gt;"X": [1, 2, 3, 4, 5],&lt;BR /&gt;"and": [2, 4, 6, 8, 10]&lt;BR /&gt;}&lt;BR /&gt;and in Query headers:&lt;BR /&gt;Content-Type application/json&lt;BR /&gt;When doing a connection test: Connection succeeded&lt;BR /&gt;But when trying to send as a variable inside the script I'm having problems:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;LIB CONNECT TO 'REST_http127.0.0.15000predict';&lt;/P&gt;
&lt;P&gt;// Define the X and Y strings in Qlik&lt;BR /&gt;let X = '1,2,3,4,5';&lt;BR /&gt;let y = '2,4,6,8,10';&lt;/P&gt;
&lt;P&gt;// // Convert the strings X and Y to JSON strings&lt;BR /&gt;// let jsonData = '{"X": [' &amp;amp; X &amp;amp; '], "y": [' &amp;amp; Y &amp;amp; ']}';&lt;/P&gt;
&lt;P&gt;// Make the POST request to the API using RestPost()&lt;BR /&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root"&lt;BR /&gt;WITH CONNECTION(&lt;BR /&gt;Url "$(url)",&lt;BR /&gt;HTTPHEADER "Content-Type" "application/json",&lt;BR /&gt;BODY "{"X":[$(X)],"y":[$(y)]}"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;// Load the API results into a Qlik table&lt;BR /&gt;table:&lt;BR /&gt;LOAD *&lt;BR /&gt;RESIDENT RestConnectorMasterTable;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2025 23:02:17 GMT</pubDate>
    <dc:creator>olgaavalos</dc:creator>
    <dc:date>2025-03-19T23:02:17Z</dc:date>
    <item>
      <title>Connect Qlik to API REST</title>
      <link>https://community.qlik.com/t5/Data-Movement-Streaming/Connect-Qlik-to-API-REST/m-p/2098473#M1288</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have the connection to the REST API, when trying to send the list X and Y in the body as a variable, it gives me an error that it does not recognize the input parameter that is being sent. Your help please.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When creating the connection, I put as parameters in RequestBody:&lt;BR /&gt;{&lt;BR /&gt;"X": [1, 2, 3, 4, 5],&lt;BR /&gt;"and": [2, 4, 6, 8, 10]&lt;BR /&gt;}&lt;BR /&gt;and in Query headers:&lt;BR /&gt;Content-Type application/json&lt;BR /&gt;When doing a connection test: Connection succeeded&lt;BR /&gt;But when trying to send as a variable inside the script I'm having problems:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;LIB CONNECT TO 'REST_http127.0.0.15000predict';&lt;/P&gt;
&lt;P&gt;// Define the X and Y strings in Qlik&lt;BR /&gt;let X = '1,2,3,4,5';&lt;BR /&gt;let y = '2,4,6,8,10';&lt;/P&gt;
&lt;P&gt;// // Convert the strings X and Y to JSON strings&lt;BR /&gt;// let jsonData = '{"X": [' &amp;amp; X &amp;amp; '], "y": [' &amp;amp; Y &amp;amp; ']}';&lt;/P&gt;
&lt;P&gt;// Make the POST request to the API using RestPost()&lt;BR /&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root"&lt;BR /&gt;WITH CONNECTION(&lt;BR /&gt;Url "$(url)",&lt;BR /&gt;HTTPHEADER "Content-Type" "application/json",&lt;BR /&gt;BODY "{"X":[$(X)],"y":[$(y)]}"&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;// Load the API results into a Qlik table&lt;BR /&gt;table:&lt;BR /&gt;LOAD *&lt;BR /&gt;RESIDENT RestConnectorMasterTable;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 23:02:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Movement-Streaming/Connect-Qlik-to-API-REST/m-p/2098473#M1288</guid>
      <dc:creator>olgaavalos</dc:creator>
      <dc:date>2025-03-19T23:02:17Z</dc:date>
    </item>
  </channel>
</rss>

