Servicem8-node typescript API and lack of filtering capabaility

servicem8-node seemed like a good way to start interacting with the API in typescript without rolling out my own. One feature that is undocumented or missing is how to filter in `listXX` APIs.

The project doesn’t allow for issue creation, I was wondering if it was abandoned or if they were any plants to support filtering.

Hi Ed,

At the REST API level, filtering is supported using the $filter query parameter. The documented syntax is GET /api_1.0/{resource}.json?$filter={field} {operator} {value}, for example GET /api_1.0/job.json?$filter=status eq 'Work Order' or GET /api_1.0/job.json?$filter=active eq 1.

Supported operators are eq, ne, gt, and lt, and multiple conditions can be combined with and up to 10 conditions in a single request. String values need single quotes, numeric values shouldn’t be quoted, and filter expressions should be URL encoded.

Filters can also be combined with cursor pagination, for example GET /api_1.0/job.json?$filter=active eq 1&cursor=-1. The pagination docs also note that the ServiceM8 TypeScript SDK provides automatic pagination support.

On the SDK roadmap side, we generally won’t comment on if or when a requested improvement might be released, but product feedback can be sent to support@servicem8.com with the problem or opportunity you’re trying to solve.

Thanks,
Cody