<?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>Questions on WEB API Object</title><link>https://community.appian.com/discussions/f/integrations/21242/questions-on-web-api-object</link><description>Hi, 
 Need help on below. Could someone please help me? 
 I have few questions on Web API objects: 
 
 Can I use query parameters in Post method? In what scenario? 
 Where can we use Query Parameters as well as body in Post method? 
 When I am trying</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Questions on WEB API Object</title><link>https://community.appian.com/thread/82848?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 13:49:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0af6ac0a-0185-4a00-a1b9-a753b838c6c0</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Sure you can use both query parameters and body in a POST. Like Danny said, you can reference both of them using the http! domain. The main thing to make sure is that whatever system you&amp;#39;re making the request from adds the parameters in a way that you can use it. Here&amp;#39;s an example of how you can pull both the query parameters and body to start a process based on the details from the request:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!queryParameters: http!request.queryParameters,
  local!body a!fromJson(
    http!request.body
  ),
  a!startProcess(
    processModel: cons!MY_PROCESS_MODEL,
    processParameters: {
      queryParameters: local!queryParameters,
      body: local!body
    },
    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!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;
        }
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions on WEB API Object</title><link>https://community.appian.com/thread/82845?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 11:52:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e73e1954-49e1-4396-aa22-5d7b92bff2fc</guid><dc:creator>faisalf0003</dc:creator><description>&lt;p&gt;Hi Danny,&lt;/p&gt;
&lt;p&gt;Thank you for the answers. I am clear about first and second questions.&lt;/p&gt;
&lt;p&gt;I will rephrase my second question.&lt;/p&gt;
&lt;p&gt;In a same web API object creation can&amp;nbsp; Query parameters and Body both be used? if yes, in what scenario?&lt;/p&gt;
&lt;p&gt;If no, it means at a time only one thing either Query Parameter or Body can be used. Kindly correct me if this is a wrong understanding.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Faisal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions on WEB API Object</title><link>https://community.appian.com/thread/82815?ContentTypeID=1</link><pubDate>Mon, 21 Jun 2021 15:45:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a2f92c4-bff9-4c1e-8025-5f963e4547ce</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;The Web API objects are really cool as they can be any Appian expression. You can access the entire HTTP requesting using the HTTP!request domain&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/21.2/Designing_Web_APIs.html#accessing-the-http-request"&gt;https://docs.appian.com/suite/help/21.2/Designing_Web_APIs.html#accessing-the-http-request&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;1. You can use query parameters for a POST method, it&amp;#39;s really up to you as you are defining the API requirements. Common query parameters might be sorting information or locale information&lt;/p&gt;
&lt;p&gt;2. Looking at the docs above, you can use HTTP!request.queryParameters to access the query parameters anywhere in your expression.&lt;/p&gt;
&lt;p&gt;3. When updating a database row using a!writeToDataStore() you must always provide all fields, otherwise fields get overwritten. To do this, query the row from the database first, then use a!update() to update the new field before writing to the database.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>