<?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: Trestclient sending json in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284844#M58466</link>
    <description>Think it will be better if You attach screenshots of Your components (with properties)</description>
    <pubDate>Tue, 25 Oct 2016 01:27:27 GMT</pubDate>
    <dc:creator>vapukov</dc:creator>
    <dc:date>2016-10-25T01:27:27Z</dc:date>
    <item>
      <title>Trestclient sending json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284839#M58461</link>
      <description>Hello, 
&lt;BR /&gt;I am trying to consume an API that needs as input a json file in talend. 
&lt;BR /&gt;I tried to send the json file in different ways, from the file directly, from the file and then using txmlmap and generate the structure of the json file in txmlmap and then send it to trestclient but I have difficulties 
&lt;BR /&gt;I have tested multiple scenarios but no success, the only way I was able to do it is by putting the json data that need to be sent using tfixedflowinput -&amp;gt; trestclient , by using tfixedflowinput it works fine 
&lt;BR /&gt;but when tried multiple scenarios I get each time either that is doesnt recognize the fields (error from the API saying that the fields are mandatory) or I receive during the compilation the error:A JSONObject text must begin with '{' at 1 
&lt;BR /&gt;when I use tfileoutputjson -&amp;gt; txmlmap -&amp;gt; trestclient and I receive A JSONObject text must begin with '{' at 1 
&lt;BR /&gt;the json structure seems fine, when I do a debug run, it seems that it sends the data to trestclient in xml format instead of json even though I mentioned in the trestclient that the input is in json because the API accepts only json format 
&lt;BR /&gt;I tried also using twritejsonfield -&amp;gt; trestclient, in the debug run it seems to send the correct json data in the right format but it still giving me the error A JSONObject text must begin with '{' at 1 
&lt;BR /&gt; 
&lt;BR /&gt;the json data sent is: 
&lt;BR /&gt; 
&lt;PRE&gt;{&lt;BR /&gt;   "configurationId":"a125zy48451q",&lt;BR /&gt;   "callLanguage":"EN",&lt;BR /&gt;   "callId":"11111",&lt;BR /&gt;   "client":{&lt;BR /&gt;      "clientNumber":"0000021417001",&lt;BR /&gt;      "clientExternalReference":"ABC123",&lt;BR /&gt;      "name":"CompanyName",&lt;BR /&gt;      "telephone":"111111111",&lt;BR /&gt;      "faxNumber":"000000002",&lt;BR /&gt;      "email":"info@domain.com",&lt;BR /&gt;      "website":"www.domain.com",&lt;BR /&gt;      "headOfficeNumber":"0000021417000",&lt;BR /&gt;      "address":{&lt;BR /&gt;         "street":"streetname",&lt;BR /&gt;         "streetNumber":"10",&lt;BR /&gt;         "streetBox":"3",&lt;BR /&gt;         "zipCode":"10000",&lt;BR /&gt;         "city":"CityName",&lt;BR /&gt;         "countryCode":"100"&lt;BR /&gt;      },&lt;BR /&gt;      "bankAccount":{&lt;BR /&gt;         "iban":"999999999999",&lt;BR /&gt;         "bic":"BICCODE"&lt;BR /&gt;      },&lt;BR /&gt;      "declaration":{&lt;BR /&gt;         "language":"0",&lt;BR /&gt;         "rsz1":"000-111111-22",&lt;BR /&gt;         "enterpriseNumber":"2222222222"&lt;BR /&gt;      },&lt;BR /&gt;      "invoiceData":{&lt;BR /&gt;         "vatCode":"0",&lt;BR /&gt;         "vatCountry":"FR",&lt;BR /&gt;         "vatNumber":"22222222222",&lt;BR /&gt;         "invoiceType":""&lt;BR /&gt;      },&lt;BR /&gt;      "clientData":{&lt;BR /&gt;         "unionCode":"1",&lt;BR /&gt;         "startDateSocialBalance":"02",&lt;BR /&gt;         "endDateSocialBalance":"10"&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;can you please help 
&lt;BR /&gt;thank you</description>
      <pubDate>Fri, 21 Oct 2016 14:18:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284839#M58461</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-21T14:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Trestclient sending json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284840#M58462</link>
      <description>Hi 
&lt;BR /&gt;Read the data from json file and then use a tXMLMap to build the Document and select the content Type as 'Json' on tRestClient, if it can't still work, please let us know what's the parameter name and its data type required for your API. 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 24 Oct 2016 04:27:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284840#M58462</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-24T04:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trestclient sending json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284841#M58463</link>
      <description>Hello Shong,&amp;nbsp; 
&lt;BR /&gt;thanks for your answer 
&lt;BR /&gt;I have tested your suggestion, it is giving me an error on trestclient error flow log that some fields are mandatory for the API, so it sends what I provide as data but it is not in the correct format to be read by the api 
&lt;BR /&gt;this is my flow: 
&lt;BR /&gt;tfileinputjson -main-&amp;gt; txmlmap -out-&amp;gt; trestclient -error-&amp;gt; tlogrow&amp;nbsp; 
&lt;BR /&gt;I then run in debug mode, the out row is in xml which is not accepted by the API and I believe this is from where comes the issue 
&lt;BR /&gt;is there a way to fix this please? 
&lt;BR /&gt;Kind regards</description>
      <pubDate>Mon, 24 Oct 2016 13:52:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284841#M58463</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-24T13:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trestclient sending json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284842#M58464</link>
      <description>Also check - what JSON object name for input for the tRESTClient 
&lt;BR /&gt;depending from API it could be Body or String 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MByi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151371i9652049894B9FA70/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MByi.png" alt="0683p000009MByi.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 24 Oct 2016 14:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284842#M58464</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2016-10-24T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trestclient sending json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284843#M58465</link>
      <description>thanks vapukov for the example but weird, I can't seem to get it to work, I am definitely missing something but can't figure it out&lt;BR /&gt;I have tried what you have suggested but the weird is that the output of txmlmap is in xml format, anyway to control this to be in json?&lt;BR /&gt;thank you</description>
      <pubDate>Mon, 24 Oct 2016 21:48:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284843#M58465</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-24T21:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trestclient sending json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284844#M58466</link>
      <description>Think it will be better if You attach screenshots of Your components (with properties)</description>
      <pubDate>Tue, 25 Oct 2016 01:27:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trestclient-sending-json/m-p/2284844#M58466</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2016-10-25T01:27:27Z</dc:date>
    </item>
  </channel>
</rss>

