The TrackTik API has many functions for filtering result sets from API GET calls so that you can find what you need more quickly.
Most of the filters are documented in our Redocly documentation like at: https://partnerships.staffr.net/rest/v1#section/Usage/Filtering-Results but we'll review the basics here and add additional information for filtering for polymorphic objects.
Basic Filters
Most of the API's filtering functions are written as:
key:function=value
- Key: the key of the JSON, like firstName
- Function: the filter function, like: contains (contains string of value), :gt (greater than, for integers and floats), :after (date function, for after a date or datetime) and more.
- Value: the value to look for or boolean test with
The below are all examples of API calls with filters applied:
firstName EQUALS EXACTLY the letters"ted". Not case sensitive.
GET /employees?firstName=Ted
full name CONTAINS "ted" somewhere in it. Not case sensitive.
GET /employees?name:contains=Ted
id EQUALS EXACTLY any of the comma listed items
GET /clients?id:in=32,24
reportDateTime values are after midnight of 2025-09-01
GET /reports?reportDateTime:after=2025-09-01 00:00:00
You can also do useful sorting, like on the primary key of records (id) with the sort filter:
- id:sort=id (ascending)
- id:sort=-id (descending)
Polymorphic Object Filters
Polymorphic Objects usually have a type, and a value, and the value is usually a referential index to another object/record.
If you look at a /report-template-fields record for example, you'll notice that it has a polymorphic object associated of type report-templates (which refers to a parent record in /report-templates:
{
===> "parent": {
"type": "report-templates",
"object": 28
},
"id": 29,
"label": "Arrival Time:",
"name": "f_29",
"type": "TIME",
"required": false,
"adminOnly": false,
"displayOrder": 100,
"extra": "",
"list": null,
"listItems": null,
"isDispatcherField": false,
"fieldTag": "scylla",
"confidential": false,
"repeatable": false
}If you want to apply filters to a polymorphic object like the above, the key:function= of basic filters is written as key:function(type)= . Another difference is that the = symbol is no longer used for equality by default because an equal() function exists more explicitly.
Examples:
Report Template Fields where their parent Report Template has an id of exactly 28
GET /report-template-fields?parent:equal(report-templates)=28
Report Template Fields where their parent Report Templates have an id of exactly 28 or 27
GET /report-template-fields?parent:in(report-templates)=28,27
Report Template Fields where their parent Report Templates have an id greater than 27
GET /report-template-fields?parent:gt(report-templates)=27