Filtering & Sorting
Every collection endpoint (for example GET /trucks) accepts criteria
filters. You filter by appending an operator suffix to a field name and
passing it as a query parameter:
field.operator=value
Multiple filters are combined with AND — a row must match every filter to be returned.
# Active Freightliner tractors from 2020 onward, newest unit number first.
curl "https://dev-gw.tracksafe365.com/services/glssafety/api/public/trucks\
?make.equals=Freightliner\
&active.equals=true\
&year.greaterThanOrEqual=2020\
&sort=unitNumber,desc" \
-H "Authorization: $TS365_API_KEY"
Operators
The operators available on a field depend on its type.
| Operator | Applies to | Meaning |
|---|---|---|
.equals | all | Exact match |
.notEquals | all | Not equal |
.in | all | Matches any value in a comma-separated list |
.notIn | all | Matches none of a comma-separated list |
.specified | all | true → field is non-null; false → field is null |
.contains | string | Substring match (case-insensitive) |
.doesNotContain | string | Negated substring match |
.greaterThan | number, date | Strictly greater than |
.lessThan | number, date | Strictly less than |
.greaterThanOrEqual | number, date | Greater than or equal |
.lessThanOrEqual | number, date | Less than or equal |
.in / .notIn take a comma-separated list, and the parameter may also be
repeated:
?id.in=1,2,3
?unitNumber.in=1042&unitNumber.in=1043
Filterable fields — Trucks
| Field | Type | Operators |
|---|---|---|
id | integer | equals, notEquals, in, notIn, specified, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual |
model | string | equals, notEquals, in, notIn, specified, contains, doesNotContain |
make | string | equals, notEquals, in, notIn, specified, contains, doesNotContain |
unitNumber | string | equals, notEquals, in, notIn, specified, contains, doesNotContain |
vin | string | equals, notEquals, in, notIn, specified, contains, doesNotContain |
year | integer | equals, notEquals, in, notIn, specified, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual |
active | boolean | equals, notEquals, in, notIn, specified |
licensePlateNo | string | equals, notEquals, in, notIn, specified, contains, doesNotContain |
licensePlateIssueDate | date-time | equals, notEquals, in, notIn, specified, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual |
companyId | integer | equals, notEquals, in, notIn, specified, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual |
globalId | string | equals, notEquals, in, notIn, specified, contains, doesNotContain |
Fields not listed above — such as
vehicleType,fuelType,note, andintegrationVin— are returned in the response but are not filterable.
Sorting
Use sort to order results, formatted as property,(asc|desc). The direction
is optional and defaults to ascending. Repeat the parameter for a multi-key
sort:
?sort=year,desc&sort=unitNumber,asc
Distinct
Pass distinct=true to collapse duplicate rows that can appear when filtering
across joined relations.
Related
- Pagination — the
page/sizecontrols and thePageresponse envelope these results are wrapped in.