Dec 3, 2021 7:59 AM
Hi,
Is there a way to search for contacts by filtering by "associatedcompanyid" field?
Actually I'm using this endpoint: POST /crm/v3/objects/contacts/search
with this body:
{
"filterGroups": [
{
"filters": [
{
"operator": "EQ",
"propertyName": "associatedcompanyid",
"value": "4972672985"
}
]
}
]
}
But it returns 0 results
Thanks
Solved! Go to Solution.
Dec 3, 2021 10:20 AM
Hi @SRamosBarroso ,
Try it with the following payload:
Associations
Search for records that are associated with other specific records by using the pseudo-property associations.{objectType}.
For example, the request below searches for all tickets associated with a contact that has the contact ID of 123:
{
"filters": [
{
"propertyName": "associations.contact",
"operator": "EQ",
"value": "123"
}
]
}
You can search through associations by using the following pseudo-property values:
associations.company
associations.contact
associations.ticket
associations.deal
associations.quote
To search for associations to a specific custom object record, you can use use the above pseudo--property with the custom object's objectTypeId, which you can retrieve through the custom object's schema. For example, associations.2-214573.
I found this information at https://developers.hubspot.com/docs/api/crm/search
Regards Ronald
Dec 3, 2021 10:20 AM
Hi @SRamosBarroso ,
Try it with the following payload:
Associations
Search for records that are associated with other specific records by using the pseudo-property associations.{objectType}.
For example, the request below searches for all tickets associated with a contact that has the contact ID of 123:
{
"filters": [
{
"propertyName": "associations.contact",
"operator": "EQ",
"value": "123"
}
]
}
You can search through associations by using the following pseudo-property values:
associations.company
associations.contact
associations.ticket
associations.deal
associations.quote
To search for associations to a specific custom object record, you can use use the above pseudo--property with the custom object's objectTypeId, which you can retrieve through the custom object's schema. For example, associations.2-214573.
I found this information at https://developers.hubspot.com/docs/api/crm/search
Regards Ronald