Query Objects
Queries
This function allows you to retrieve a list of objects matching specified criteria.
Relative URL | HTTP Request Method |
---|---|
| GET |
| GET |
| GET |
Replace
model
with the type of object that you wish to retrieve (as defined in your app's Data Model), for exampleperson
,job
orasset
.Multiple query criteria can be specified.
Certain "hidden" fields are prefixed with an underscore, for example: to query on the
updated_at
hidden field, use_updated_at
.
Parameters
Query parameters are specified as a URL-encoded query
or q
hash. Valid keys for this hash are the names of the fields in that model. The format for the values is the same as for creating objects. Please refer to the same section at Creating a New Object.
You can specify your criteria with logic such as 'equals', 'not equal to', 'greater than', 'less than', etc. as follows:
Comparison | Syntax | Allowed Values |
---|---|---|
Equals |
| |
is Not Equal To |
| |
is Less Than |
| |
is Less Than or Equal To |
| |
is Greater Than |
| |
is Greater Than or Equal To |
| |
Contains |
| |
is Null (or Not Null) |
| Specify |
The contains
operator is case-sensitive.
Response
The response includes a list of all the objects of the given type which match all of the query criteria. The format of the objects is the same as for listing all objects (please refer to the Retrieve All Objects section.)
Examples
BASE-URL
The below examples contain a BASE-URL
placeholder. Please refer to the HTTP Endpoints section to get the base URL relevant to your deployment.
When using curl with queries you have to either escape the square brackets with a backslash \
or add the -g
option to turn off curl's globbing functionality.
Match a text field:
Match multiple fields, including human-readable dates:
Query with datetime
in ISO8601 format:
datetime
in ISO8601 format:Match a value (as a string) from a single-choice field:
Query on a relationship - Find all assets related to the specified room:
Searching Across All Fields
You can also search through all the fields of all objects of a given type for a partial text match. This can be useful for implementing basic search functions.
Relative URL | HTTP Request Method |
---|---|
| POST |
Parameters
The search text must be specified as a URL-encoded parameter named query
.
Example
BASE-URL
The below examples contain a BASE-URL
placeholder. Please refer to the HTTP Endpoints section to get the base URL relevant to your deployment.
Search task
objects for the text "site":
task
objects for the text "site":Response:
Last updated