Hi, HubSpot community
I’m using the HubSpot python library to search contacts by email:
filters = [Filter(property_name="email", operator="EQ", value="test@test.com")]
filter_group = FilterGroup(filters=filters)
request = PublicObjectSearchRequest(
filter_groups=[filter_group],
limit=1,
properties=["hs_object_id"]
)
api_client.crm.contacts.search_api.do_search(search_request)
And this is the response I get:
{'paging': {'next': {'after': '1', 'link': None}}, 'results': [], 'total': 2}
However, if I modify my request and set limit=2, I get the only registry that exists with that email:
{'paging': None,
'results': [{'archived': False,
'archived_at': None,
'created_at': datetime.datetime(2023, 2, 3, 9, 58, 20, 684000, tzinfo=tzutc()),
'id': '60551',
'properties': {'hs_object_id': '60551'},
'properties_with_history': None,
'updated_at': datetime.datetime(2023, 2, 3, 9, 59, 4, 657000, tzinfo=tzutc())}],
'total': 2}
It’s interesting that in both responses, “total” is 2, even when there’s only one record with that email.
Another thing to notice is that this problem doesn’t happen with all the emails.
1) Does anyone know why this could happen?
2) What’s the meaning of “total”? Is it the total amount of registries with that email? If that’s the meaning, the value is totally wrong.
Thanks in advance,
Adrian