how to set api filter for "multiple checkboxes" field type?

hi,

I have this custom property for Contacts called “mh_instance” (internal value)

Currently, this is how i do it

$client = \HubSpot\Factory::createWithApiKey('MY_API_KEY'); 
$searchRequest = new \HubSpot\Client\Crm\Contacts\Model\PublicObjectSearchRequest(); 
$filters = []; 
$conditions = [ 'email' => 'test@example.com', 'mh_instance' => 'AU' ]; 
$field_operators = [ 'email' => 'EQ', 'mh_instance' => 'IN' ]; 
$fields = ['email']; 

foreach($conditions as $property_name => $property_value){ 
 $curFilter = new \HubSpot\Client\Crm\Contacts\Model\Filter(); 
 $operator = $field_operator[$property_name]; 
 $curFilter->setOperator($operator)->setPropertyName($property_name)->setValue($property_value); 
 $filters[] = $curFilter;
 } 

 $filterGroup = new \HubSpot\Client\Crm\Contacts\Model\FilterGroup(); 
 $filterGroup->setFilters($filters); 
 $searchRequest->setFilterGroups([$filterGroup]); 
 $searchRequest->setProperties($fields); 
 $searchRequest->setLimit(1); 

 try { 
 $apiResponse = $client->crm()->contacts()->searchApi()->doSearch($searchRequest); 

 if($apiResponse['total'] >= 1){ 
 $tmp = $apiResponse['results'][0]['properties']; 
 return [ 
 'id' => $tmp['hs_object_id'], 'date_added' => $tmp['createdate'], 'date_modified' => $tmp['lastmodifieddate'] 
 ];
 } 
 else 
 return false; 
} 
 catch (ApiException $e) { return false; }

request body

{
 "filterGroups": [
 {
 "filters": [
 {
 "value": "AU",
 "propertyName": "mh_instance",
 "operator": "IN"
 },
 {
 "value": "test@example.com",
 "propertyName": "email",
 "operator": "EQ"
 }
 ]
 }
 ],
 "properties": [
 "email",
 "mh_instance"
 ],
 "limit": 100
}

but im getting the following result

{
 "status": "error",
 "message": "Invalid input JSON on line 1, column 88: Cannot construct instance of `com.hubspot.inbounddb.publicobject.core.v3.search.Filter`, problem: operator IN requires values",
 "correlationId": "2c85d210-c5f2-4849-9c75-291e44851a45"
}

@DBiler

Are you just wanting to check if there is a value in the property or are you wanting that specific value?

If first: HAS_PROPERTY

If second: EQ

@dennisedson
Can You please explain the second ? What do you mean by EQ.
It would be nice if you can give an example on the json or any documentation link
Thanks

@UMuhammad21 ,

Rereading this, I believe my advice was not the best. Let me update it,

For a multiselect, the EQ operator will not work. What you will need to do is do multiple filters with the IN operator.

Example:

I have a property with 3 value options: option1, option2, option3
I have a contact with option1 and option2 selected.

The JSON I can send to return only contacts with thos two values would look like this

{
 "filterGroups":[
 {
 "filters":[
 {
 "propertyName": "multi_check",
 "operator": "IN",
 "values":["option1"]
 },
 {
 "propertyName": "multi_check",
 "operator": "IN",
 "values":["option2"]
 }
 ]
 }
 ]
 }

Hope that clears this up and sorry again for the misinformation. I think I read the question too quickly!