The ServiceM8 API supports filtering of results by providing $filter option as part of a GET query request:
$filter=FIELD OPERATOR 'VALUE'
|FIELD||A valid field name for the current endpoint/record|
|OPERATOR||The type of comparison/operator|
|VALUE||The value to search for / compare against|
Ensure that your filter statement is URL-encoded (see examples below), otherwise the API will return all records with no filtering applied.
All Job records for a single client
$filter is company_uuid eq ‘10420f98-7626-4405-bf43-043f1036623b’
curl -u email:password "https://api.servicem8.com/api_1.0/job.json?%24filter=company_uuid%20eq%20'10420f98-7626-4405-bf43-043f1036623b'"
All Job where invoiced amount was greater than $1000.00
$filter is total_invoice_amount gt ‘1000.00’
curl -u email:password "https://api.servicem8.com/api_1.0/job.json?%24filter=total_invoice_amount%20gt%20'1000.00'"
Date of Last Revision: July 1, 2014