<?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: Error when setting up tRest with JSON in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Error-when-setting-up-tRest-with-JSON/m-p/2316658#M87185</link>
    <description>You have to escape the " within the json content and add + between the lines to get a clear java String.
&lt;BR /&gt;
&lt;PRE&gt;"{  \n"&lt;BR /&gt;    + "   \"action\":\"createOnly\",\n"&lt;BR /&gt;    + "   \"lookupField\":\"email\",\n"&lt;BR /&gt;    + "   \"partitionName\":\"name\",\n"&lt;BR /&gt;    + "   \"input\":[  \n"&lt;BR /&gt;    + "      {  \n"&lt;BR /&gt;    + "         \"email\":\"email@email1.com\",\n"&lt;BR /&gt;    + "         \"firstName\":\"Kataldar-1\",\n"&lt;BR /&gt;    + "         \"postalCode\":\"04828\"\n"&lt;BR /&gt;    + "      },\n"&lt;BR /&gt;    + "      {  \n"&lt;BR /&gt;    + "         \"email\":\"kjashaedd-2@klooblept.com\",\n"&lt;BR /&gt;    + "         \"firstName\":\"Kataldar-2\",\n"&lt;BR /&gt;    + "         \"postalCode\":\"04828\"\n"&lt;BR /&gt;    + "      },\n"&lt;BR /&gt;    + "      {  \n"&lt;BR /&gt;    + "         \"email\":\"kjashaedd-3@klooblept.com\",\n"&lt;BR /&gt;    + "         \"firstName\":\"Kataldar-3\",\n"&lt;BR /&gt;    + "         \"postalCode\":\"04828\"\n"&lt;BR /&gt;    + "      }\n"&lt;BR /&gt;    + "   ]\n"&lt;BR /&gt;    + "}"&lt;/PRE&gt;
&lt;BR /&gt;It is a bit cumbersome but unfortunately Talend has not added here the same convenience as we have for SQL in the database components.</description>
    <pubDate>Thu, 04 Aug 2016 20:20:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-08-04T20:20:51Z</dc:date>
    <item>
      <title>Error when setting up tRest with JSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Error-when-setting-up-tRest-with-JSON/m-p/2316657#M87184</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;I am getting an error when attempting to add JSON to the http body field in the tRest component.&lt;BR /&gt;The JSON I am inserting into the http body field is:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;"{ &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"action":"createOnly",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"lookupField":"email",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"partitionName":"name",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"input":[ &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"email":"email@email1.com",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"firstName":"Kataldar-1",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"postalCode":"04828"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"email":"kjashaedd-2@klooblept.com",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"firstName":"Kataldar-2",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"postalCode":"04828"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"email":"kjashaedd-3@klooblept.com",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"firstName":"Kataldar-3",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"postalCode":"04828"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp;]&lt;BR /&gt;}"&lt;BR /&gt;&lt;BR /&gt;The errors I get are:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MFaj.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137455i837BD0A7ACEE4458/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MFaj.png" alt="0683p000009MFaj.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I can run the component ok when I use a content type of&amp;nbsp;"application/x-www-form-urlencoded". Any idea what format this JSON needs to be in in order to be accepted, the JSON has been taken directly from the Marketo create leads example request.&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 14:22:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Error-when-setting-up-tRest-with-JSON/m-p/2316657#M87184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-04T14:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error when setting up tRest with JSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Error-when-setting-up-tRest-with-JSON/m-p/2316658#M87185</link>
      <description>You have to escape the " within the json content and add + between the lines to get a clear java String.
&lt;BR /&gt;
&lt;PRE&gt;"{  \n"&lt;BR /&gt;    + "   \"action\":\"createOnly\",\n"&lt;BR /&gt;    + "   \"lookupField\":\"email\",\n"&lt;BR /&gt;    + "   \"partitionName\":\"name\",\n"&lt;BR /&gt;    + "   \"input\":[  \n"&lt;BR /&gt;    + "      {  \n"&lt;BR /&gt;    + "         \"email\":\"email@email1.com\",\n"&lt;BR /&gt;    + "         \"firstName\":\"Kataldar-1\",\n"&lt;BR /&gt;    + "         \"postalCode\":\"04828\"\n"&lt;BR /&gt;    + "      },\n"&lt;BR /&gt;    + "      {  \n"&lt;BR /&gt;    + "         \"email\":\"kjashaedd-2@klooblept.com\",\n"&lt;BR /&gt;    + "         \"firstName\":\"Kataldar-2\",\n"&lt;BR /&gt;    + "         \"postalCode\":\"04828\"\n"&lt;BR /&gt;    + "      },\n"&lt;BR /&gt;    + "      {  \n"&lt;BR /&gt;    + "         \"email\":\"kjashaedd-3@klooblept.com\",\n"&lt;BR /&gt;    + "         \"firstName\":\"Kataldar-3\",\n"&lt;BR /&gt;    + "         \"postalCode\":\"04828\"\n"&lt;BR /&gt;    + "      }\n"&lt;BR /&gt;    + "   ]\n"&lt;BR /&gt;    + "}"&lt;/PRE&gt;
&lt;BR /&gt;It is a bit cumbersome but unfortunately Talend has not added here the same convenience as we have for SQL in the database components.</description>
      <pubDate>Thu, 04 Aug 2016 20:20:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Error-when-setting-up-tRest-with-JSON/m-p/2316658#M87185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-04T20:20:51Z</dc:date>
    </item>
  </channel>
</rss>

