<?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: Call tRestClient with Post by passing Json body in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283319#M57263</link>
    <description>&lt;P&gt;That would be a better approach if you want to produce JSON&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2020 15:10:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-04T15:10:58Z</dc:date>
    <item>
      <title>Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283310#M57254</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am actually starting to learn Talend and I have this scenario: I need to call Rest WS, get the results, transform data so that it respect q certqin metadata Schema, then call another Rest Webservice, to post the data. What I used as components are : TRestClient -&amp;gt; tExtractJsonField -&amp;gt;TMap -&amp;gt; tRestWebservice. In the latest WS, I need :&lt;/P&gt;
&lt;P&gt;- Send request one by one so should I use flowToIterate&lt;/P&gt;
&lt;P&gt;- From the flow coming from the TMap, how can I prepare a Json body to send it in the Post of tRestClient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting an error /&amp;nbsp;javax.ws.rs.WebApplicationException: HTTP 400 Bad Request&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="talend-flow.PNG" style="width: 985px;"&gt;&lt;IMG src="https://yutwg22796.i.lithium.com/t5/image/serverpage/image-id/24772i2EE0D0F462494C7E/image-size/large?v=1.0&amp;amp;px=999" title="talend-flow.PNG" alt="talend-flow.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:22:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283310#M57254</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T03:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283311#M57255</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;tRestClient requries a document as input request, you need to use a tXMLMap instead of tMap to build the document.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Or you can use tRest to call API and use tWriteJsonField to write a Json string and pass it to tRest.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Shong&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 09:05:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283311#M57255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T09:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283312#M57256</link>
      <description>&lt;P&gt;Hello Shong&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks for the reply. Ok let's assume that I will use the txmlMap. So the flow will be like this&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ws-with_txml.PNG" style="width: 977px;"&gt;&lt;IMG src="https://yutwg22796.i.lithium.com/t5/image/serverpage/image-id/24773i0528C42500F0DEB4/image-size/large?v=1.0&amp;amp;px=999" title="ws-with_txml.PNG" alt="ws-with_txml.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I am right? Now I still have&amp;nbsp;javax.ws.rs.WebApplicationException: HTTP 400 Bad Request&lt;/P&gt; 
&lt;P&gt;NB: I am trying to send only one record. here my tXmlMap&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ws-with_txml2.PNG" style="width: 999px;"&gt;&lt;IMG src="https://yutwg22796.i.lithium.com/t5/image/serverpage/image-id/24774i607A2006CABE3CFE/image-size/large?v=1.0&amp;amp;px=999" title="ws-with_txml2.PNG" alt="ws-with_txml2.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 10:09:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283312#M57256</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T10:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283313#M57257</link>
      <description>Have you tried your API using Postman? Does it works? Can you show an example of Json string that are required as input request?</description>
      <pubDate>Tue, 04 Feb 2020 10:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283313#M57257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T10:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283314#M57258</link>
      <description>&lt;P&gt;Yes I have tried with postman. This is the body that I send&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman.PNG" style="width: 678px;"&gt;&lt;IMG src="https://yutwg22796.i.lithium.com/t5/image/serverpage/image-id/24778i633A1F43810A0980/image-size/large?v=1.0&amp;amp;px=999" title="postman.PNG" alt="postman.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 10:46:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283314#M57258</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T10:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283315#M57259</link>
      <description>&lt;P&gt;The tXMLMap does not produce JSON. You need to send your JSON as a String to the tRestClient's "string" column. You also need to set the tRestClient up to receive JSON.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 11:58:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283315#M57259</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T11:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283316#M57260</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After using the tXMLMap, the output is as below&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xml_output.PNG" style="width: 443px;"&gt;&lt;IMG src="https://yutwg22796.i.lithium.com/t5/image/serverpage/image-id/24789i8435DA5C926A59F1/image-size/large?v=1.0&amp;amp;px=999" title="xml_output.PNG" alt="xml_output.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I send it as Json String?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 12:20:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283316#M57260</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T12:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283317#M57261</link>
      <description>&lt;P&gt;Create JSON and do not use the tXMLMap.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 14:34:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283317#M57261</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T14:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283318#M57262</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So shall I go for this solution instead of using a txmlMap&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capturejson.PNG" style="width: 999px;"&gt;&lt;IMG src="https://yutwg22796.i.lithium.com/t5/image/serverpage/image-id/24796i7F104AC287860C3F/image-size/large?v=1.0&amp;amp;px=999" title="Capturejson.PNG" alt="Capturejson.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 15:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283318#M57262</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T15:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283319#M57263</link>
      <description>&lt;P&gt;That would be a better approach if you want to produce JSON&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 15:10:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283319#M57263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-04T15:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283320#M57264</link>
      <description>&lt;P&gt;Did you manage to sort out how to&amp;nbsp;execute the trestclient?&lt;/P&gt;&lt;P&gt;&amp;nbsp;How do you pass all field from input row to a json document inside the body of the trestclient.&lt;/P&gt;&lt;P&gt;Could trestclient body allow to mapped expected field to pass from the current row?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 18:27:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283320#M57264</guid>
      <dc:creator>Nordom_LH</dc:creator>
      <dc:date>2020-02-27T18:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283321#M57265</link>
      <description>&lt;P&gt;This is demonstrated in the solution image. If you read the rest of the post, the information is there.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 21:38:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283321#M57265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-27T21:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283322#M57266</link>
      <description>&lt;P&gt;Thanks for the hint, I have read the full post including image, I am still lost on what to do inside tmap and jsonwrite&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 08:24:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283322#M57266</guid>
      <dc:creator>Nordom_LH</dc:creator>
      <dc:date>2020-02-28T08:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283323#M57267</link>
      <description>&lt;P&gt;I have sort it out: just need to put the loop in the first field int twritejsonfield, &amp;nbsp;check the remove root node and ensure trestclient is fully configured in json, I now have to understand why null are transformed in []&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 09:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283323#M57267</guid>
      <dc:creator>Nordom_LH</dc:creator>
      <dc:date>2020-02-28T09:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283324#M57268</link>
      <description>&lt;P&gt;Great news! I try to give enough information in my posts so that others can figure it out for themselves for similar issues. I find that you learn the product better if you have to struggle a little on your own&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 09:24:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283324#M57268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-28T09:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283325#M57269</link>
      <description>&lt;P&gt;to fixe the null transformed &lt;SPAN class="str"&gt;[ ] :&amp;nbsp;&lt;/SPAN&gt;in Insert a &lt;STRONG&gt;tJavaRow&lt;/STRONG&gt; with the following code right after your tWriteJsonField:&lt;/P&gt; 
&lt;PRE&gt;&lt;SPAN class="pln"&gt;output_row&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;string &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; input_row&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;string&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;replaceAll&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;",?\"[a-zA-Z_0-9]*\":\\[\\]"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt; &lt;SPAN class="str"&gt;""&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt; 
&lt;P&gt;thanks to&lt;A href="https://stackoverflow.com/users/4783389/jbalberge" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;&amp;nbsp;&lt;/A&gt;&lt;A href="https://stackoverflow.com/users/4783389/jbalberge" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;Jbalberge&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;initial post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCoDFCA0" target="_blank" rel="nofollow noopener noreferrer noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-Empty-Null-fields-show-up-in-json-output/td-p/92913&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 09:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283325#M57269</guid>
      <dc:creator>Nordom_LH</dc:creator>
      <dc:date>2020-02-28T09:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283326#M57270</link>
      <description>&lt;P&gt;In order to resolve the issue of Null array generated by the tWriteJsonField, yu need to declare the attribute as object and not String Like below&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Talend Null.png" style="width: 794px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M9d0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152420i752784A162AE86EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M9d0.png" alt="0683p000009M9d0.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 11:22:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283326#M57270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-04T11:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Call tRestClient with Post by passing Json body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283327#M57271</link>
      <description>&lt;P&gt;For me the following solution works:&lt;/P&gt;&lt;P&gt;tMap -&amp;gt; tWriteJSONField -&amp;gt; tRestClient&lt;/P&gt;&lt;P&gt;Here's the big picture:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009roibAAA.gif"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145594i2C56F1B63C0B4A86/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009roibAAA.gif" alt="0693p000009roibAAA.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Do not propagate schemas or retrieve schemas from a target component.&lt;/P&gt;&lt;P&gt;Especially not from the tRESTClient. This could destroy it's schemas and then you need to put a new one.&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>Wed, 07 Oct 2020 19:21:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Call-tRestClient-with-Post-by-passing-Json-body/m-p/2283327#M57271</guid>
      <dc:creator>LuciusHunt</dc:creator>
      <dc:date>2020-10-07T19:21:15Z</dc:date>
    </item>
  </channel>
</rss>

