Hey, I’m trying to integrate Hubspot with our payment gateway which processes thousands of updates every day.
To reduce overheating and work around the API Rate limit, I’m using the batch API.
I’m trying to implement a batch update of 200 records and for this, I need to find the id of all objects I’m trying to update. I’m running a search trying to find objects by properties, let’s say “email” to simplify.
The problem I’m finding is that I can’t seem to find a working example of how to use the IN operator. I always get an error related to parsing the filter object. I’ve tried sending a comma separated value, a JSON stringified value or a plain JSON object array.
I tried passing “value” or “values”. Nothing worked.
I’ve followed this documentation:
I’m using the official nodejs SDK.
And also tried the solutions in this thread:
https://community.hubspot.com/t5/APIs-Integrations/Hubspot-API-How-do-you-use-IN-filter-operator/td-p/512907
Sending multiple filter groups worked, but it only accepts 5 and I need 200.
Here is a pseudocode of what I’ve been trying to do:
async findAll(objectType : string, emails: string[]) {
const filterGroups: FilterGroup[] = [
{
filters : [
{
value : emails,
propertyName: 'email',
operator: 'IN'
}
]
}
]
return this.getClient().crm.objects.searchApi.doSearch(objectType, filterGroups);
}