<?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 Parameters of a POST API call in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Parameters-of-a-POST-API-call/m-p/2508452#M21889</link>
    <description>&lt;P&gt;Hi everyone, I have some code that extracts data from an API.&amp;nbsp; it works fine...until I try to put in some parameters, like...bring back data for the current day.&lt;BR /&gt;&lt;BR /&gt;I have done this by putting some code in the $(BodyString) as you will see below...but it then gives me an error.&lt;BR /&gt;If I remove this line the data loads, so it is definitely here that is causing the problem.&amp;nbsp; I am just unsure how to solve it.&amp;nbsp; Any ideas?&amp;nbsp; (Even if i try to harcode the BodyString I also encounter issues.&amp;nbsp; )&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Let vToday = Date(Today(), 'DD/MM/YYYY');  // Define today's date
Let BodyString = '{' &amp;amp; Chr(34) &amp;amp; 'recordCreateDate' &amp;amp; Chr(34) &amp;amp; ':' &amp;amp; Chr(34) &amp;amp; vToday &amp;amp; Chr(34) &amp;amp; '}';

trace BodyString $(BodyString);


LIB CONNECT TO 'POST_API';
SQL SELECT 
	"accountRef",
	"name",
	"balance",
	"accountOnHold",
	"accountStatusText",
	"creditLimit",
	"turnoverYtd",
	"inactiveAccount"
FROM JSON (wrap off) "results" 
WITH CONNECTION(Url "https://FakeCompany:40027/api/searchLedger"),
BODY "$(BodyString)"
);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Mar 2025 15:40:21 GMT</pubDate>
    <dc:creator>bx12345</dc:creator>
    <dc:date>2025-03-05T15:40:21Z</dc:date>
    <item>
      <title>Parameters of a POST API call</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Parameters-of-a-POST-API-call/m-p/2508452#M21889</link>
      <description>&lt;P&gt;Hi everyone, I have some code that extracts data from an API.&amp;nbsp; it works fine...until I try to put in some parameters, like...bring back data for the current day.&lt;BR /&gt;&lt;BR /&gt;I have done this by putting some code in the $(BodyString) as you will see below...but it then gives me an error.&lt;BR /&gt;If I remove this line the data loads, so it is definitely here that is causing the problem.&amp;nbsp; I am just unsure how to solve it.&amp;nbsp; Any ideas?&amp;nbsp; (Even if i try to harcode the BodyString I also encounter issues.&amp;nbsp; )&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Let vToday = Date(Today(), 'DD/MM/YYYY');  // Define today's date
Let BodyString = '{' &amp;amp; Chr(34) &amp;amp; 'recordCreateDate' &amp;amp; Chr(34) &amp;amp; ':' &amp;amp; Chr(34) &amp;amp; vToday &amp;amp; Chr(34) &amp;amp; '}';

trace BodyString $(BodyString);


LIB CONNECT TO 'POST_API';
SQL SELECT 
	"accountRef",
	"name",
	"balance",
	"accountOnHold",
	"accountStatusText",
	"creditLimit",
	"turnoverYtd",
	"inactiveAccount"
FROM JSON (wrap off) "results" 
WITH CONNECTION(Url "https://FakeCompany:40027/api/searchLedger"),
BODY "$(BodyString)"
);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 15:40:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Parameters-of-a-POST-API-call/m-p/2508452#M21889</guid>
      <dc:creator>bx12345</dc:creator>
      <dc:date>2025-03-05T15:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Parameters of a POST API call</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Parameters-of-a-POST-API-call/m-p/2508466#M21890</link>
      <description>&lt;P&gt;Just to update,I can get the load to run when i try and put in a different requestBody but it does not filter the way I would expect. I would assume this would filter to the account name ABC.&amp;nbsp; I am using the name for that field from the API schema.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LIB CONNECT TO 'POST_API';
SQL SELECT 
	"accountRef",
	"name",
	"balance",
	"accountOnHold",
	"accountStatusText",
	"creditLimit",
	"turnoverYtd",
	"inactiveAccount"
FROM JSON (wrap off) "results" 
WITH CONNECTION(Url "https://FakeCompany:40027/api/searchLedger"),
BODY "{""NAME"":""ABC""}" 
);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 16:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Parameters-of-a-POST-API-call/m-p/2508466#M21890</guid>
      <dc:creator>bx12345</dc:creator>
      <dc:date>2025-03-05T16:49:20Z</dc:date>
    </item>
  </channel>
</rss>

