Difference between revisions of "REST API:Dynamic Search"
From AgileApps Support Wiki
imported>Aeric |
imported>Aeric |
||
Line 17: | Line 17: | ||
:*<tt>page</tt> - Number of the logical page in a database result set. The first page is page "zero" (0). | :*<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. | :: 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, in addition to the number returned in the current batch, contained in the result code. It causes the following to be returned, where <tt>N</tt> is the total number of records: | :* <tt>getTotalRecordCount</tt> returns the number of total records, in addition to the number returned in the current batch, contained in the result code. It causes the following to be returned, where <tt>N</tt> is the total number of records: | ||
::<syntaxhighlight lang="xml" enclose="div"> | ::<syntaxhighlight lang="xml" enclose="div"> | ||
Line 34: | Line 28: | ||
</platform> | </platform> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
:*<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>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) | |||
:::For more information, see: [[Specifying Query Parameters in REST APIs]]<noinclude> | :::For more information, see: [[Specifying Query Parameters in REST APIs]]<noinclude> | ||
Revision as of 02:45, 1 April 2014
- Query Parameters
- fieldList - A comma-separated list of field names to retrieve
- 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.
- filter - Filtering criteria to filter the records
- For more examples, see Filter Expressions in REST APIs and the REST API Examples.)
- 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, in addition to the number returned in the current batch, contained in the result code. It causes the following 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)
- sortBy - Field name for primary sort
- 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.