Difference between revisions of "REST API:Dynamic Search"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 3: Line 3:
{{#ifeq: {{PAGENAME}} | REST API:composite record Resource |  <!--match-->  
{{#ifeq: {{PAGENAME}} | REST API:composite record Resource |  <!--match-->  
::* The asterisk (<tt>*</tt>) wildcard specifies all fields in the primary record  
::* The asterisk (<tt>*</tt>) wildcard specifies all fields in the primary record  
::* <tt>{fieldname}</tt> specifies a field in the primary record (e.g. <tt>name</tt>)
::* <tt>{fieldname}</tt> specifies a field in the main record (e.g. <tt>name</tt>)
::* <tt>{alias}.*</tt> specifies all fields in a secondary record  
::* <tt>{alias}.*</tt> specifies all fields in a related record  
::* <tt>{alias}.{fieldname}</tt> specifies a field in a secondary record (e.g. <tt>tag.id</tt>)
::* <tt>{alias}.{fieldname}</tt> specifies a field in a related record (e.g. <tt>tag.id</tt>)
::: ...etc.   
::: ...etc.   
|                                                <!--no match-->
|                                                <!--no match-->
::* The asterisk (<tt>*</tt>) wildcard specifies all fields                 
::* The asterisk (<tt>*</tt>) wildcard specifies all fields                 
::*Use the [[REST API:field Resource]] to get a complete list of fields
::*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.}}
::*Field lists for database views need to specify the object's alias, as well as the field name.
:*<tt>alias.*</tt> specifies all fields in the aliased object.


:*<tt>filter</tt> - Filtering criteria to filter the records
:*<tt>filter</tt> - Filtering criteria to filter the records

Revision as of 03:23, 18 November 2014

Query Parameters
  • fieldList - A comma-separated list of field names to retrieve

{{#ifeq: REST API:Dynamic Search | REST API:composite record Resource |

  • The asterisk (*) wildcard specifies all fields in the primary record
  • {fieldname} specifies a field in the main record (e.g. name)
  • {alias}.* specifies all fields in a related record
  • {alias}.{fieldname} specifies a field in a related record (e.g. tag.id)
...etc.

|

  • The asterisk (*) wildcard specifies all fields
  • 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.
  • 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:
<syntaxhighlight lang="xml" enclose="div">

<platform>

  ...
  <message>
     0
     <description>Success</description>
  </message>
  <totalRecordCount>N</totalRecordCount> 

</platform> </syntaxhighlight>

  • 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.