I used that page to create the object to filter by name and tried it in Postman with a test company we have (so it already exists and should return a non-empty result). However, it doesn't return anything.
If I do a getAll from companies and later filter it by the name property, I can find the company with its properties. But this method isn't a good solution since it can take around 30 seconds to execute and return all the companies.
So... Am I doing something wrong in the object that I have to pass as a filter, or this method doesn't work with the property name?
Thanks for your reply but as I said in my previous reply, my issue is that I need the object as I posted in my screenshot of Postman for calling the HubSpot API through Node with the method hubspotClient.crm.companies.searchApi.doSearch(publicObjectSearchRequest) as it says in the official documentation, which is falling to function as it should be.
Calling it from curl with an object with another format is of no use for me since I'm using a typed HubSpot API method in Typescript & Node.
Jul 29, 20214:57 AM - edited Jul 29, 20215:04 AM
Participant
API v3 (@hubspot/api-client) Companies doSearch method doesn't filter with property name in Node
Hi @dennisedson thanks for your answer, it works in Postman now.
But I want to use it in Node with the following method: hubspotClient.crm.companies.searchApi.doSearch(objectToFilterCompaniesByName)
And what you have given me, doesn't work in Typescript & Node because is asking for an object with the same syntax that I have written in my first screenshot.
API v3 (@hubspot/api-client) Companies doSearch method doesn't filter with property name in Node
Old case, but did you resolve this? Running against a similar problem with hubspotClient.crm.companies.searchApi.doSearch; it;s just bringing me all my companies by creation date, completely ignoring the search string.