<?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 API Call - Dynamic JSON Message Body in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339808#M107903</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an urgent requirement where I would need to use the tREST component for making a API call to a MDM platform. &lt;/P&gt;&lt;P&gt;For this I would need to pass a JSON as a message body to the tREST component. Based on the response I would need to update the initial JSON message body and pass it again to obtain the next response. Like wise, this iteration will go on until all the records are fetched.&lt;/P&gt;&lt;P&gt;Now, updating the JSON message body based on the response obtained is where I am having the difficulty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically the update here is to remove an attribute from the original JSON and add a new attribute to it. and the value of the newly added attribute will vary based on the response obtained for every iteration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please suggest some ways for JSON updating.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:13:20 GMT</pubDate>
    <dc:creator>Sriram151515</dc:creator>
    <dc:date>2024-11-16T00:13:20Z</dc:date>
    <item>
      <title>tREST API Call - Dynamic JSON Message Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339808#M107903</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an urgent requirement where I would need to use the tREST component for making a API call to a MDM platform. &lt;/P&gt;&lt;P&gt;For this I would need to pass a JSON as a message body to the tREST component. Based on the response I would need to update the initial JSON message body and pass it again to obtain the next response. Like wise, this iteration will go on until all the records are fetched.&lt;/P&gt;&lt;P&gt;Now, updating the JSON message body based on the response obtained is where I am having the difficulty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically the update here is to remove an attribute from the original JSON and add a new attribute to it. and the value of the newly added attribute will vary based on the response obtained for every iteration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please suggest some ways for JSON updating.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:13:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339808#M107903</guid>
      <dc:creator>Sriram151515</dc:creator>
      <dc:date>2024-11-16T00:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: tREST API Call - Dynamic JSON Message Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339809#M107904</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Can you show us an example to explain the Json message format and where need to be updated?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 06:45:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339809#M107904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-26T06:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: tREST API Call - Dynamic JSON Message Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339810#M107905</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000EaEuuAAF.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145256i0D635BB51BAF8525/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000EaEuuAAF.jpg" alt="0695b00000EaEuuAAF.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000EaEukAAF.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151191i50CF6358D9DB3EA4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000EaEukAAF.jpg" alt="0695b00000EaEukAAF.jpg" /&gt;&lt;/span&gt;Hi Shong,&lt;/P&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;Please find attached screenshots, &lt;/P&gt;&lt;P&gt;The initial_json_body.jpg screenshot is the message body to be used for initial rest api call. The response from the api call will contain the scrollId. I have fetched that and stored in a context variable. That value is to be used for the subsequent api calls with the updated json message body.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 07:17:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339810#M107905</guid>
      <dc:creator>Sriram151515</dc:creator>
      <dc:date>2021-04-26T07:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: tREST API Call - Dynamic JSON Message Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339811#M107906</link>
      <description>&lt;P&gt;@Shicong Hong​&amp;nbsp;: Any updates on this would be really helpful. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 08:08:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339811#M107906</guid>
      <dc:creator>Sriram151515</dc:creator>
      <dc:date>2021-04-26T08:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: tREST API Call - Dynamic JSON Message Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339812#M107907</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two ways you can try.&lt;/P&gt;&lt;P&gt;1 Extract all the data from json message in the beginning and rewrite the Json message using tWriteJsonField after extract the scrollId.&lt;/P&gt;&lt;P&gt;2 Hard code to replace the string between "scroll_id" and "query" with new scrollId value. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 09:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339812#M107907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-26T09:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: tREST API Call - Dynamic JSON Message Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339813#M107908</link>
      <description>&lt;P&gt;@Shicong Hong​&amp;nbsp;: Thanks for the update Shong. The second way hard coding the scroll id might not work out because the number of iterations is expected to go roughly to 70-100. So each time we need to hard code the scroll id obtained from the response.&lt;/P&gt;&lt;P&gt;I will give a try with the first method using twriteJson after extracting the values.  Any examples would be helpful.         &lt;/P&gt;&lt;P&gt;Alternatively, is there a way we could write some code using tJavaRow or TJava to replace the attribute from original json i.e "scroll" with "scroll_id" as expected in the updated json and then keep updating them inside tjavarow/tjava. &lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 09:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339813#M107908</guid>
      <dc:creator>Sriram151515</dc:creator>
      <dc:date>2021-04-26T09:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: tREST API Call - Dynamic JSON Message Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339814#M107909</link>
      <description>&lt;P&gt;Here is a &lt;A href="https://help.talend.com/r/Xr~HqMTCU7gC3dT5ZSikKQ/~AQ4CDn96vq~lvQ8pYhMqw" alt="https://help.talend.com/r/Xr~HqMTCU7gC3dT5ZSikKQ/~AQ4CDn96vq~lvQ8pYhMqw" target="_blank"&gt;scenario &lt;/A&gt;about tWriteJsonField component, take a look at the documentation and learn it. Let me know if you have any questions. &lt;/P&gt;&lt;P&gt;If you know Java knowledge, you want replace the attribute from original on tJava component.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 10:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tREST-API-Call-Dynamic-JSON-Message-Body/m-p/2339814#M107909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-27T10:17:56Z</dc:date>
    </item>
  </channel>
</rss>

