Hello!
I am trying to retrieve all contacts that have a specific set of vids (IDs - canonical or otherwise) via the Search Endpoint and the ‘hs_all_contact_vids’ property:
{
"updatedAt": "2022-05-27T20:57:17.998Z",
"createdAt": "2019-08-06T02:41:10.764Z",
"name": "hs_all_contact_vids",
"label": "All vids for a contact",
"type": "enumeration",
"fieldType": "select",
"description": "A set of all vids, canonical or otherwise, for a contact",
"groupName": "contactinformation",
"options": [],
"displayOrder": -1,
"calculated": true,
"externalOptions": false,
"hasUniqueValue": false,
"hidden": true,
"hubspotDefined": true,
"modificationMetadata": {
"archivable": true,
"readOnlyDefinition": true,
"readOnlyValue": true
},
"formField": false
}
When retrieving data via “/crm/v4/objects/contacs”, as can be seen below ‘hs_all_contact_vids’ si returned as ‘201;251’
{
"id": "251",
"properties": {
"createdate": "2022-09-22T04:02:01.807Z",
"firstname": "John2",
"hs_all_contact_vids": "201;251",
"hs_object_id": "251",
"lastmodifieddate": "2023-03-27T15:53:36.095Z"
},
"createdAt": "2022-09-22T04:02:01.807Z",
"updatedAt": "2023-03-27T15:53:36.095Z",
"archived": false
}
However, this query returns no resulsts:
{
"limit": 1,
"after": 0,
"filterGroups": [
{
"filters": [
{
"propertyName": "hs_all_contact_vids",
"operator": "EQ",
"value": "201;251"
}
]
}
],
"properties": [
"id"
]
}
Changing the above to IN and values resolves the issue:
{
"limit": 100,
"after": 0,
"filterGroups": [
{
"filters": [
{
"propertyName": "hs_all_contact_vids",
"operator": "IN",
"values": ["201","251"]
}
]
}
],
"properties": [
"firstname",
"hs_all_contact_vids"
]
}
But why does this occurr? Why does IN work and not EQ? Is there some API usage rule I am missing? Any information on this behavior and how to generally handle it would be appreciated.