Please advise - I need to get the associated companies’ IDs for chosen deals.
Here is the URL:
POST https://api.hubapi.com/crm/v3/objects/deals/search
And the body:
filters = [
{ "propertyName": "dealstage",
"operator": "IN",
"values": stage_ids }
]
if owner_ids:
filters.append(
{ "propertyName": "hubspot_owner_id",
"operator": "IN",
"values": owner_ids
})
payload =
{
"filterGroups":
[{ "filters": filters }],
"properties":
["dealstage", "dealname", "pipeline", "associatedCompanyId"],
"associations": ["company"]
}
And in the response, I don’t receive associatedCompanyId or other information about the company.
I know that I can use Associations API to get company info like this:
url = f"https://api.hubapi.com/crm/v3/objects/deals/{deal_id}/associations/company
But in this case, I’d need to do it for every deal, which I don’t want to do. Please advise.