<?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>Call a process from a GET Web API</title><link>https://community.appian.com/discussions/f/integrations/13905/call-a-process-from-a-get-web-api</link><description>Hello, 
 I need to build several Web API&amp;#39;s that, besides doing their main purpose, register in the database the parameters received and the date &amp;amp; time that the call occurred (basically, a customized log). I&amp;#39;ve started by creating the web API&amp;#39;s with their</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Call a process from a GET Web API</title><link>https://community.appian.com/thread/120409?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 01:29:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8b16e65a-1f56-44f7-9a7a-567e3eb2b3c4</guid><dc:creator>Madhu RK</dc:creator><description>&lt;p&gt;Yes we can call&amp;nbsp;&amp;nbsp;write the data store entity and&amp;nbsp;&lt;span&gt;&amp;nbsp;start a process one in another&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;in the Web API&amp;nbsp; something like below&lt;pre class="ui-code" data-mode="text"&gt; a!writeToDataStoreEntity(
        dataStoreEntity: cons!DSE_NAME,
        valueToStore: local!constructRequest,
        onSuccess: a!startProcess(
          processModel: cons!PM_NAME,
          processParameters: {
            inputJason: a!toJson({ aa: fv!storedValues })
          },
          onSuccess: a!httpResponse(
            statusCode: 200,
            headers: {
              a!httpHeader(
                name: &amp;quot;Content-Type&amp;quot;,
                value: &amp;quot;application/json&amp;quot;
              )
            },
            body: a!toJson({ aa: fv!storedValues, bb: fv!processInfo })
          ),
          onError: a!httpResponse(
            statusCode: 500,
            headers: {
              a!httpHeader(
                name: &amp;quot;Content-Type&amp;quot;,
                value: &amp;quot;application/json&amp;quot;
              )
            },
            body: a!toJson(
              {
                error: &amp;quot;There was an error starting the process&amp;quot;
              }
            )
          )
        ),
        onError: a!httpResponse(
          statusCode: 500,
          headers: {
            a!httpHeader(
              name: &amp;quot;Content-Type&amp;quot;,
              value: &amp;quot;application/json&amp;quot;
            )
          },
          body: a!toJson(
            {
              error: &amp;quot;There was an error writing to the data store&amp;quot;
            }
          )
        )
      )&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call a process from a GET Web API</title><link>https://community.appian.com/thread/63123?ContentTypeID=1</link><pubDate>Fri, 30 Nov 2018 11:58:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8e24d0cd-f59c-4aaf-a9f1-1498334cfc89</guid><dc:creator>paulc919</dc:creator><description>Hi ... I think the JBOSS / TOMCAT access log (18.3 and higher for TOMCAT) will register the webAPI calls - not sure if that will include parameters or not though. You could try checking that access log in the root directory of the logs to see if it contains the information you need.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call a process from a GET Web API</title><link>https://community.appian.com/thread/63119?ContentTypeID=1</link><pubDate>Fri, 30 Nov 2018 08:37:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7255ffd7-42c7-411d-bcba-af847186c65e</guid><dc:creator>susanan0001</dc:creator><description>Thank you both for your answers! &lt;br /&gt;
&lt;br /&gt;
The problem of the a!startprocess() is that 1) it&amp;#39;s asynchronous and 2) I can&amp;#39;t  pass values out of the process for the a!httpResponse(). &lt;br /&gt;
I was trying to do both things separately inside the Web API, because I need to give a response (ex: calculate something, get/post client data) and to log the request.&lt;br /&gt;
Should I try a different approach? For example, trying to retrieve the information from the Appian Logs?&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Susana&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call a process from a GET Web API</title><link>https://community.appian.com/thread/63111?ContentTypeID=1</link><pubDate>Fri, 30 Nov 2018 03:41:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5ebd69e9-2228-41c9-a63a-210d9050c22a</guid><dc:creator>aloks0189</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/susanan0001"&gt;susanan0001&lt;/a&gt;&amp;nbsp;as per my understanding, you need to change your implementation approach a bit.&lt;br /&gt; &lt;br /&gt; Instead of calling two smart service functions together, (while working with POST/PUT/DELETE but not GET API methods) try calling a!startprocess() which will trigger the target process model, pass necessary information as it&amp;#39;s parameter and persist the data into the DB using Write to Data Store Entity Smart Service and then call the actual process, which you were trying to invoke.&lt;br /&gt; &lt;br /&gt; Hope this will help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Call a process from a GET Web API</title><link>https://community.appian.com/thread/63105?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 18:35:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:44c5b994-4400-4b71-b20e-4face0cca096</guid><dc:creator>Josh</dc:creator><description>1) You can&amp;#39;t call smart services with GET API&amp;#39;s, only POST/PUT/DELETE methods will allow you to launch a smart service.&lt;br /&gt;
&lt;br /&gt;
2) Could you pass in the log info to the process and write to the data store inside of your process instance? To get around having to put this DSE node for the Web API log in each process you will invoke, you could create a pass-through process model that writes to the DSE and then invokes the start process node to start the relevant process model.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>