<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Best Practice to call Rest API in Appian</title><link>https://community.appian.com/discussions/f/best-practices/10970/best-practice-to-call-rest-api-in-appian</link><description>Hi All, 
 I have one requirement where I need to call a Rest API, parse the response and persist the data for all the number of rows present in one of our tables. Currently we have around 4000 rows in the table for which I need to call the API, so it</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Best Practice to call Rest API in Appian</title><link>https://community.appian.com/thread/64286?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 06:00:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9b882e94-cf96-4284-aec1-b0e52a2dce1c</guid><dc:creator>Vadivelan</dc:creator><description>Try this approach, if you are planning to store the data in db on some tables.&lt;br /&gt;
&lt;br /&gt;
Directly execute the Integration rule which fetches the data from API in the Execute Stored Procedure call input rather than passing a pv variable input. In this way you can avoid storing the huge data in pv and in turn its memory efficient.&lt;br /&gt;
&lt;br /&gt;
Further you can also define the pv variable property as hidden, so that it will not be captured in Process History and it gives better performance. Below link gives further information on the same.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://community.appian.com/w/the-appian-playbook/220/creating-memory-efficient-models"&gt;community.appian.com/.../creating-memory-efficient-models&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Vadivelan&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best Practice to call Rest API in Appian</title><link>https://community.appian.com/thread/47975?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2017 06:44:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7da9c29a-9b84-4302-8463-6fca03843b69</guid><dc:creator>PGarg</dc:creator><description>Thanks Alok,&lt;br /&gt;
&lt;br /&gt;
Customization of API is not possible so this possibility is ruled out&lt;br /&gt;
Yes following batch size approach is what I am currently adhering to, but just wanted to know any better ways.&lt;br /&gt;
&lt;br /&gt;
Here I am facing one more challenge I need to store the response from each API call to some other table using Stored procedure call OR write the response in some flat file using doc generation smart service, for both the approaches I have to store the response in PV which I need to avoid as response is extremely huge for each call (Multiply 4000).&lt;br /&gt;
&lt;br /&gt;
Any alternate for the same.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best Practice to call Rest API in Appian</title><link>https://community.appian.com/thread/47973?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2017 06:35:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3e28a0b1-789d-40e3-bdc1-a6573618297b</guid><dc:creator>aloks0189</dc:creator><description>As per my understanding, here we can have only 2 possibilities to invoke the API&lt;br /&gt;
1) 1 API call for each iteration (which is not a good idea in terms of performance)&lt;br /&gt;
2) If you want to avoid the above approach, then you might need to do some customization from API side. If customization is possible (i mean, if you are the one who has designed the API as well), then try converting multiple rows into JSON and send it to API, where in API side, you need to parse and store the input into an array, collect entire information from API DB&amp;gt; Convert that back into JSON / XML and send that as a response to Appian/Client.&lt;br /&gt;
&lt;br /&gt;
But this approach is only feasible, if there is any chance to customize the API, else there are no other options apart from 1 API call for each iteration/row&lt;br /&gt;
&lt;br /&gt;
However, in case you can&amp;#39;t customize the API, but also you want to think about your performance, then i would recommend, fetch the data in Batch (let&amp;#39;s say 100), once the 100 rows gets processed then you can pause/terminate the process and can restart the process after a couple of hours again, by the help of Timer. Which will make sure that, you are not going to process the entire rows at a time.&lt;br /&gt;
&lt;br /&gt;
I hope, one of these options might suite your requirement.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best Practice to call Rest API in Appian</title><link>https://community.appian.com/thread/47972?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2017 06:21:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae44e002-2f84-49db-aa4a-8a00d7fade0b</guid><dc:creator>PGarg</dc:creator><description>Let me clarify with an example:&lt;br /&gt;
&lt;br /&gt;
Example - I have 4000 Customer Ids in DB and for each Id I need to call a third party Rest API to get customer relevant data in XML format which I need to parse and then store the customer details (from XML) in Appian DB&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best Practice to call Rest API in Appian</title><link>https://community.appian.com/thread/47971?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2017 06:16:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:de74f077-7465-476f-b690-a72732184cb7</guid><dc:creator>aloks0189</dc:creator><description>So, Does that mean, you want to send the Appian data to the REST API?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best Practice to call Rest API in Appian</title><link>https://community.appian.com/thread/47970?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2017 06:15:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:360faed9-111e-4422-b9a9-f8e7b202fd2c</guid><dc:creator>PGarg</dc:creator><description> &lt;br /&gt;
Client side (Appian DB) has 4000 rows and we need to call Rest API 4000 times.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best Practice to call Rest API in Appian</title><link>https://community.appian.com/thread/47969?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2017 06:13:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e600ce07-1ac8-422f-a073-5b75c06607f1</guid><dc:creator>aloks0189</dc:creator><description> One Question, before i proceed to provide any suggestion:&lt;br /&gt;
&lt;br /&gt;
Does the Service side DB(Where the REST API is exposed) contains 4000 rows, or Client Side (Appian/Your system). Because as per above description, what i have understood is, there are 4000 rows available and will be returned by the REST API which you would like to parse and store into Appian Mapped DB.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please let me know, whether i understood your requirement or not.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>