Difference between revisions of "REST API:Dynamic Search"

From AgileApps Support Wiki
imported>Aeric
 
imported>Aeric
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
:;Query Parameters:
:;Query Parameters:
{{#ifeq: {{PAGENAME}} | REST API:composite Resource
:*<tt>fieldList</tt> - A comma-separated list of field names to retrieve
|:*<tt>fieldList</tt> - A comma-separated list of field names to retrieve   <!--match-->
 
::* The asterisk (<tt>*</tt>) wildcard specifies all fields in the primary record
::* The asterisk (<tt>*</tt>) wildcard specifies all fields              
::* <tt>{fieldname}</tt> specifies a field in the primary record (e.g. <tt>name</tt>)
::* <tt>{fieldname}</tt> specifies an individual field (e.g. <tt>name</tt>)
::* <tt>{alias}.*</tt> specifies all fields in a secondary record  
::: (Use the [[REST API:field Resource]] to get a complete list of fields.)
::* <tt>{alias}.{fieldname}</tt> specifies a field in a secondary record (e.g. <tt>tag.id</tt>)
::* For a [[Composite Object]], specify <tt>{alias}.{fieldname}</tt> to select a related-record field, where the alias is defined in the [[Object Relationships]].
::: ...etc.
::* For a [[Database View]], specify <tt>{alias}.{fieldname}</tt>, where the object alias is defined in the Database View.
|:*<tt>fieldList</tt> - A comma-separated list of field names to retrieve
::* <tt>alias.*</tt> specifies all fields in the aliased object.
::* The asterisk (<tt>*</tt>) wildcard specifies all fields               <!--no match-->
::*Use the [[REST API:field Resource]] to get a complete list of fields
::*Field lists for database views need to specify the object's alias, as well as the field name.}}


:*<tt>filter</tt> - Filtering criteria to filter the records
:*<tt>filter</tt> - Filtering criteria to filter the records
::*For more examples, see [[REST API:Filter Expressions in REST APIs|Filter Expressions in REST APIs]] and the [[REST API:Filter Expressions in REST APIs#REST API Examples|REST API Examples]].)
::*For more examples, see [[REST API:Filter Expressions in REST APIs|Filter Expressions in REST APIs]] and the [[REST API:Filter Expressions in REST APIs#REST API Examples|REST API Examples]].)
:*<tt>page</tt> - Page number of the logical page in a database result set
:*<tt>pageSize</tt> - Number of records to retrieve from the result set in order to make a "page".
:*<tt>pageSize</tt> - Number of records to retrieve from the result set in order to make a "page".
:*<tt>page</tt> - Number of the logical page in a database result set. The first page is page "zero" (0).
:: Page zero is returned by default, so appending <tt>&pageSize=1</tt> to your query returns a single record.
:* <tt>getTotalRecordCount</tt> returns the number of total records.<br>Causes the following structure to be returned, where <tt>N</tt> is the total number of records:
::<syntaxhighlight lang="xml" enclose="div">
<platform>
  <status>
  <packageDeploy>
  ...
  </packageDeploy>
  </status>
  <message>
      <code>0</code>
      <description>Success</description>
  </message>
  <!-- added by the query param -->
  <totalRecordCount>N</totalRecordCount>
</platform>
</syntaxhighlight>
:*<tt>sortBy</tt> - Field name for primary sort<br/>Ex: <tt>&sortBy=name</tt>
:*<tt>sortBy</tt> - Field name for primary sort<br/>Ex: <tt>&sortBy=name</tt>
:*<tt>sortOrder</tt> - Sort order of the primary field, either <tt>"asc"</tt> or <tt>"desc"</tt> (ascending or descending)<br/>Ex: <tt>&sortOrder="desc"</tt>
:*<tt>sortOrder</tt> - Sort order of the primary field, either <tt>asc</tt> or <tt>desc</tt> (ascending or descending)<br/>Ex: <tt>&sortOrder=desc</tt>
:*<tt>sortBy2</tt> - Field name for secondary sort
:*<tt>sortBy2</tt> - Field name for secondary sort
:*<tt>sortOrder2</tt> - Sort order of the second field, either <tt>"asc"</tt> or <tt>"desc"</tt> (ascending or descending)
:*<tt>sortOrder2</tt> - Sort order of the second field, either <tt>asc</tt> or <tt>desc</tt> (ascending or descending)


:::For more information, see: [[Specifying Query Parameters in REST APIs]]<noinclude>
:::For more information, see: [[Specifying Query Parameters in REST APIs]]<noinclude>

Latest revision as of 10:45, 25 June 2019

Query Parameters
  • fieldList - A comma-separated list of field names to retrieve
  • The asterisk (*) wildcard specifies all fields
  • {fieldname} specifies an individual field (e.g. name)
(Use the REST API:field Resource to get a complete list of fields.)
  • For a Composite Object, specify {alias}.{fieldname} to select a related-record field, where the alias is defined in the Object Relationships.
  • For a Database View, specify {alias}.{fieldname}, where the object alias is defined in the Database View.
  • alias.* specifies all fields in the aliased object.
  • filter - Filtering criteria to filter the records
  • pageSize - Number of records to retrieve from the result set in order to make a "page".
  • page - Number of the logical page in a database result set. The first page is page "zero" (0).
Page zero is returned by default, so appending &pageSize=1 to your query returns a single record.
  • getTotalRecordCount returns the number of total records.
    Causes the following structure to be returned, where N is the total number of records:
<platform> 
   <status>
   <packageDeploy>
   ...
   </packageDeploy>
   </status>
   <message>
      <code>0</code>
      <description>Success</description>
   </message>

   <!-- added by the query param -->
   <totalRecordCount>N</totalRecordCount> 
</platform>
  • sortBy - Field name for primary sort
    Ex: &sortBy=name
  • sortOrder - Sort order of the primary field, either asc or desc (ascending or descending)
    Ex: &sortOrder=desc
  • sortBy2 - Field name for secondary sort
  • sortOrder2 - Sort order of the second field, either asc or desc (ascending or descending)
For more information, see: Specifying Query Parameters in REST APIs

This segment has two formats: One for normal searches, and another for searching Composite Objects. It generally isn't possible to embed templates and conditionals, so this page duplicates the format of Template:Query Parameters.