The Q object is an optional object of JSON Object type that can be passed as an @QueryParameter into many API calls. The purpose of this object is to format the API response. An example of such object is shown below:
All fields of the object are optional and are described below:
projection = JSON array of column names to be returned by request. In the example above, only the [WORK_ORDER_ID] and [STATUS] columns would be returned. If this field is omitted, then the request would return ALL available columns.
Note: This can be viewed as vertical filtering. |
The inner JSON arrays represent the condition to filter by:
The "AND" or "OR" strings tell how conditions should be related in the WHERE clause.
Note: The filter is written using RPN (Reverse Polish Notation), where the operators are "AND", "OR" and the operands are the three-element JSON condition arrays. This can viewed as horizontal filtering. |
In the following example, all work orders are requested and use a Q object to limit the response to return only open work orders (status = 4). The response contains only two columns, sorted by work order start date, and returns the second page where there are 20 rows per page:
<baseUrl>/workOrder?q={"filter":[["STATUS","=",4]],"projection":["WORK_ORDER_ID","STATUS"],"sort":{"START_DATE":"DESC"},"page":{"size":20,"number":2}}