I am trying to make a .Net request to https://api.hubapi.com/crm/v3/objects/deals/search to retrieve a variable number of deal objects using "account number" as the search property. The problem is that I do not know how many accounts must be returned- maybe 2, maybe 500. I have already tried to pass in a request body with >40 JSON objects in the "Filter" array, but receive a 'Bad request. Maximum number of filters is 3." message. Is there a way around this? I thank you so much!
I appreciate your help gentlemen. We came up with a solution, so all is okay. I'll continue to monitor the forum in case you add new features. Thanks again, and until then! Hutson
Yes, this is the limitation of the Search API that you can pass a maximum of 3 filters at a time. I can see you're quite close to finding a solution but I would like to add a suggestion too. So based on your accounts maybe you can break requests into a group of 3?
You are right. I read the documentation and it clearly states three filters per filter group. But I think you can have more filter groups with three filters each (but you only need two in each).
So instead of doing my way above do it "one row in" and create a big amount of filter groups.
Tell me if its unclear and I will try to give you a code example. (On my phone now so earliest tomorrow).
Thank you, Michael. I was indeed able to GET the pipeline and deal stage with your help. However, your suggested approach to searching many objects resulted in the following error:
{
"status": "error",
"message": "too many filterGroups (count: 4, max allowed: 3)",
It appears using the EQ operator cannot accomodate the number of requests we anticipate. FYI I was able to use the IN operator but it only returns partial results (i.e. some deals are not being returned even though they have matching account_number):
There are a few errors in your code - I dont know if you put them there on purpose or not so I will give you the full explaination.
In hubspots world the pipeline and dealstage have uniqe ID numbers. Since we can create an infinite amount of pipelines and an infinite amount of deal stages all get a uniqe ID.
You need to enter the id number of the pipeline and the id number of the dealstage under "value" in your code.
To get the pipeline internal ID:
In your hubspot account - go to settings - submenu Data Management then click Deals. Within deals click Pipelines.
Within pipelines select the pipeline "accounts". And then click the </> to get the pipelines internal value.
To get the dealstage internal ID:
In the same settings - hover the mouse over the dealstage "Openfunded" to get its internal value:
(ignore the fact that my deal stages are named differently in my example)