REST v2 - Discussion of handling missing Filter Parameters

@OmarAlmonte, not sure if this is by design, or something you need to discuss with your team.

Using the Contact - List Contacts endpoint, I came across something unexpected. A Contact does not have a Last Name, so when the “family_name” parameter specified with an empty value, the endpoint raised the following error below.

Filter 'family_name==' is missing'

Would it be not be better to ignore empty filter values on your side? I did not have this issue in XML-RPC as an empty Data Query Value would have been processed.

Good catch @Pav!

There are unintended consequences with this.

If I wanted to query my database for any contact records that are missing the last name, this function would break.

We should be able to query these fields that are missing data.

Hi, @Christian_Wiles and @Pav, this is by design.

This behavior occurs when a filter is provided without a value, for example filter=family_name==. In this case, the API treats it as an incomplete filter expression, which results in a 400 Bad Request.

Currently, filtering for empty values using this syntax is not supported. A valid comparison value is required for the filter to be processed; otherwise, the request is considered invalid.

@OmarAlmonte Are you saying that by design, we cannot query for fields that have empty values?

In XML-RPC Data Query there is support for NULL in the Query Data parameter.

https://developer.infusionsoft.com/docs/xml-rpc/#data-query-a-data-table

How can we handle that in REST?

The Filter parameter has no mention of searching of empty values. There will be legitimate cases where an integration needs to check if a field has been set or not.