<?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 tREST json data input in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212420#M10059</link>
    <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set and need to crapped it into json request before POST to an API&lt;/P&gt;&lt;P&gt;The json request contains many nested json hierachy, so that I cannot use the tRESTClient&lt;/P&gt;&lt;P&gt;I try to use the tREST but I don't know how to input the data into it from a tMap (this component join my data and ready to build the json input) and neither know how to extract Json from it (there is not "string" field as in tRestClient)&lt;/P&gt;&lt;P&gt;Could you please guide me for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 03:51:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T03:51:06Z</dc:date>
    <item>
      <title>tREST json data input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212420#M10059</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set and need to crapped it into json request before POST to an API&lt;/P&gt;&lt;P&gt;The json request contains many nested json hierachy, so that I cannot use the tRESTClient&lt;/P&gt;&lt;P&gt;I try to use the tREST but I don't know how to input the data into it from a tMap (this component join my data and ready to build the json input) and neither know how to extract Json from it (there is not "string" field as in tRestClient)&lt;/P&gt;&lt;P&gt;Could you please guide me for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:51:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212420#M10059</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T03:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: tREST json data input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212421#M10060</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQMaAAO"&gt;@phancongphuoc&lt;/A&gt;&amp;nbsp;,you should populate in HTTP body of tRest component,check the below link will help you more.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCmbUCAS" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/POST-JSON-with-REST-API/td-p/150057&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 12:05:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212421#M10060</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2019-12-12T12:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: tREST json data input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212422#M10061</link>
      <description>&lt;P&gt;hi Manodwhb&lt;/P&gt; 
&lt;P&gt;Thanks for your help, I use the tREST with Http Body string to build up the Json structure&lt;/P&gt; 
&lt;P&gt;But the json string is really complicated and not easy to maintain&lt;/P&gt; 
&lt;P&gt;Do we have any other approach to simplify this stage?&lt;/P&gt; 
&lt;P&gt;I saw that there is a tWriteJsonField, but I don't know how to leverage it into my case.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M82T.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155546iD03D29F00F9A4F5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M82T.jpg" alt="0683p000009M82T.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;---------- the jSon String is like this-----------------&lt;/P&gt; 
&lt;P&gt;"{\"version\":1"&lt;BR /&gt;+",\"request_id\":\""+ ((String)globalMap.get("AltanaInput.request_id")) + "\""&lt;BR /&gt;+",\"date_time\":\""+ ((String)globalMap.get("AltanaInput.date_time"))&lt;BR /&gt;+"\",\"items\":[{"&lt;BR /&gt;+"\"item_id\":\""+((String)globalMap.get("AltanaInput.item_id"))+"\""&lt;BR /&gt;+",\"date_time\":\"2019-11-21T12:23:59\""&lt;BR /&gt;+",\"declared\":{"&lt;BR /&gt;+"\"hs_code\":\""+ ((String)globalMap.get("AltanaInput.declare_hs_code")) +"\""&lt;BR /&gt;+",\"description\":\"" + ((String)globalMap.get("AltanaInput.declare_description")) + "\""&lt;BR /&gt;+",\"value\":\"" + ((String)globalMap.get("AltanaInput.declare_value")) + "\""&lt;BR /&gt;+",\"unit\":\"" + ((String)globalMap.get("AltanaInput.declare_unit")) + "\""&lt;BR /&gt;+"}"&lt;BR /&gt;+",\"route\":{"&lt;BR /&gt;+"\"origin_country\":\""+((String)globalMap.get("AltanaInput.route_origin_country"))+"\""&lt;BR /&gt;+",\"lading_country\":\""+ ((String)globalMap.get("AltanaInput.route_lading_country"))+ "\""&lt;BR /&gt;+",\"unlading_country\":\""+ ((String)globalMap.get("AltanaInput.route_unlading_country"))+ "\""&lt;BR /&gt;+",\"lading_port\":\""+ ((String)globalMap.get("AltanaInput.route_lading_port")) + "\""&lt;BR /&gt;+",\"unlading_port\":\""+ ((String)globalMap.get("AltanaInput.route_unlading_port")) + "\""&lt;BR /&gt;+"}"&lt;BR /&gt;+",\"foreign_party\":{"&lt;BR /&gt;+"\"id\":\""+ ((String)globalMap.get("AltanaInput.foreign_party_id"))+ "\""&lt;BR /&gt;+",\"name\":\""+ ((String)globalMap.get("AltanaInput.foreign_party_name"))+"\""&lt;BR /&gt;+",\"address\":\""+ ((String)globalMap.get("AltanaInput.foreign_party_address")) + "\""&lt;BR /&gt;+",\"country\":\""+ ((String)globalMap.get("AltanaInput.foreign_party_country")) + "\""&lt;BR /&gt;+"}"&lt;BR /&gt;+",\"local_party\":{"&lt;BR /&gt;+"\"id\":\""+ ((String)globalMap.get("AltanaInput.local_party_id"))+"\""&lt;BR /&gt;+",\"name\":\""+ ((String)globalMap.get("AltanaInput.local_party_name")) + "\""&lt;BR /&gt;+",\"address\":\""+ ((String)globalMap.get("AltanaInput.local_party_address"))+"\""&lt;BR /&gt;+",\"country\":\""+ ((String)globalMap.get("AltanaInput.local_party_country"))+ "\""&lt;BR /&gt;+"}"&lt;BR /&gt;+",\"quantity\":{\"value\": 3000,\"unit\":\"box\"},\"weight\":{\"value\":0.25,\"unit\":\"kg\"},\"volume\":{\"value\":0.5,\"unit\":\"cubic in\"}}]}"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 07:06:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212422#M10061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-16T07:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: tREST json data input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212423#M10062</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LQMaAAO"&gt;@phancongphuoc&lt;/A&gt;&amp;nbsp;,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I had a case similar to yours with a huge json to construct and it was boring.&lt;/P&gt; 
&lt;P&gt;Nothing but escaping all the quotation marks was painful ahah&lt;/P&gt; 
&lt;P&gt;As i see there are some parameters that you pass through global map and other that are fixed.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So you can maybe try to develop a routine who creates your java object with the jsonsimple class.&lt;/P&gt; 
&lt;P&gt;When you call the method, pass the global map fields as parameters.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In my case, it helped a lot because i was calling the method several times in my job don't know if it will be as useful for you but just sharing.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 09:57:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212423#M10062</guid>
      <dc:creator>Martintin</dc:creator>
      <dc:date>2019-12-19T09:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: tREST json data input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212424#M10063</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;
&lt;P&gt;Sorry for long delay.&lt;/P&gt;
&lt;P&gt;I finally use a tJava and set the json construction into a concept string variable, and then pass the variable into the Http Body&lt;/P&gt;
&lt;P&gt;It should be a little bit easier to maintain for me.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 02:39:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212424#M10063</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-07T02:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: tREST json data input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212425#M10064</link>
      <description>&lt;P&gt;To see how sending JSON via tRestClient works see the &lt;A href="https://community.talend.com/s/contentdocument/0693p000009roibAAA" alt="https://community.talend.com/s/contentdocument/0693p000009roibAAA" target="_blank"&gt;gif &lt;/A&gt;in my comment at the end of &lt;A href="https://community.talend.com/s/question/0D53p00007vClxOCAS/call-trestclient-with-post-by-passing-json-body" alt="https://community.talend.com/s/question/0D53p00007vClxOCAS/call-trestclient-with-post-by-passing-json-body" target="_blank"&gt;this post&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;tMap -&amp;gt; tWriteJSONField -&amp;gt; tRestClient&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 16:01:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212425#M10064</guid>
      <dc:creator>LuciusHunt</dc:creator>
      <dc:date>2020-10-08T16:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: tREST json data input</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212426#M10065</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to pass arrays through context variables in trest​ component.Could you please suggest how it can be done&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 09:06:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-json-data-input/m-p/2212426#M10065</guid>
      <dc:creator>Sindhura1</dc:creator>
      <dc:date>2021-09-21T09:06:22Z</dc:date>
    </item>
  </channel>
</rss>

