<?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>Invoke POST WebAPI</title><link>https://community.appian.com/discussions/f/integrations/22149/invoke-post-webapi</link><description>Hi, 
 
 I have created a!writeToDataStore in webAPI which is writing to DB when I test through API,to invoke this API I created an integration of Method POST and URL accepting ri! as parameters. 
 I am unable to write to DB when I test through integration</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Invoke POST WebAPI</title><link>https://community.appian.com/thread/86811?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 15:42:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aa224754-a2e5-4ce8-9909-93cfc1819788</guid><dc:creator>priyas0007</dc:creator><description>&lt;p&gt;&lt;a href="/members/danny.verb"&gt;Danny Verb&lt;/a&gt; Thats already in place will use that.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invoke POST WebAPI</title><link>https://community.appian.com/thread/86810?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 15:41:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d7c2387-fd7f-4135-ba31-6e10e0c09329</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;Yes, you can create a constant pointing to your process model and then use a!startProcess() to kick off the process model from an interface&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invoke POST WebAPI</title><link>https://community.appian.com/thread/86809?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 15:34:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c831c4eb-eb75-4dd1-93e6-3a643237861c</guid><dc:creator>priyas0007</dc:creator><description>&lt;p&gt;&lt;a href="/members/danny.verb"&gt;Danny Verb&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I already have a link for starting the process, I wanted to utilise same to add data to DB or maybe prior using local!variables or integration.&lt;/p&gt;
&lt;p&gt;But looks like will have to create a new PM to write data to DB and then invoke my usual PM&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for quick response!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invoke POST WebAPI</title><link>https://community.appian.com/thread/86803?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 13:52:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:07831d33-1a28-4c43-8d6b-67deaec4af47</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;When you say interface are you referring to an Appian Interface? You shouldn&amp;#39;t use Web APIs in your interface since you can call smart services directly. Simply place them into the saveInto field of a dynamicLink() or buttonWidget()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To test this, make an interface with a simple a!linkField(links: {a!dynamicLink( saveInto: {})}) and try to write to the database using this link.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invoke POST WebAPI</title><link>https://community.appian.com/thread/86802?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 13:44:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cd856e5a-52e1-47b7-a2ca-35239f96c041</guid><dc:creator>priyas0007</dc:creator><description>&lt;p&gt;&lt;a href="/members/danny.verb"&gt;Danny Verb&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Did that too &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But then how to I use WEB API in my interface ,if the answer is via integration, I did try that but unable to connect.&lt;/p&gt;
&lt;p&gt;I can share details for integration too.&lt;/p&gt;
&lt;p&gt;WEB API works fine,but I am unable to fetch the response in integration or directly in interface.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invoke POST WebAPI</title><link>https://community.appian.com/thread/86800?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 13:41:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9f29ab6-6e66-4579-9488-9b732c39b2ba</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;You can&amp;#39;t test Smart Services in the expression rule editor, instead, try running that code directly in the Web API designer. Also, since you don&amp;#39;t need any local variables there&amp;#39;s not need to put your a!writeToDataStoreEntity() in a local variable&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invoke POST WebAPI</title><link>https://community.appian.com/thread/86799?ContentTypeID=1</link><pubDate>Fri, 08 Oct 2021 13:35:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0e0741e7-a81f-4cf7-873c-3e07f5a1a86f</guid><dc:creator>priyas0007</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/danny.verb"&gt;Danny Verb&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the reply I tried that only first,&lt;/p&gt;
&lt;p&gt;but this is what I get in response,not sure what I am missing.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/18/pastedimage1633700108262v1.png" alt=" " /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!value:
  a!writeToDataStoreEntity(
  dataStoreEntity: cons!DS,
  valueToStore: ri!variable,
  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(
      fv!storedValues
    )
  ),
  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;
      }
    )
  )
),
local!value
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invoke POST WebAPI</title><link>https://community.appian.com/thread/86772?ContentTypeID=1</link><pubDate>Thu, 07 Oct 2021 21:08:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0bf56a59-1039-408f-a8b1-8a69674a29c4</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;You can use a!writeToDataStore() directly in your Appian interface.&lt;/p&gt;
&lt;p&gt;In the onSuccess and onFailure parameters of a!writeToDatastore you can return an HTTP response using the a!httpResponse() function. I recommend using this to help you view useful information when testing in the API designer.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>