CRM

dino56
Participant

API integration, large object search by property

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:
https://developers.hubspot.com/docs/api/crm/crm-custom-objects

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-...

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);
    }

 

0 Upvotes
1 Reply 1
Olivia_Bagnall
Guide | Platinum Partner
Guide | Platinum Partner

API integration, large object search by property

Hey @dino56!

I would recommend to move this post to the developers forum here https://community.hubspot.com/t5/HubSpot-Developers/ct-p/developers

It's monitored by devs who might be better able to help with such a query. HubSpot support are great too!



 

Olivia Bagnall

Inbound Consultant and Project Manager

Baskey

 
 
 
o.bagnall@baskey.eu
www.baskey.eu
Rheingasse 14, 50676 Köln
 
 
 

Olivia Bagnall
Platinum HubSpot Partner | HubSpot Specialist | Community Champion
BA°SKEY

Book a meeting

If you need further help with anything, please don't hesitate to book a call above


0 Upvotes