APIs & Integrations

SJohnson53
参加者

Get all contacts search by company not returning ALL contacts

解決

Doing a search for contacts based on their `associatedcompanyid` is not returning ALL of the contacts. In the CRM there are 3 contacts on the company but only 2 are being returned via the API. Checking the missing contact I can see their `associatedcompanyid` is different - all 3 contacts are associated with multiple companies - is this expected? Is there a property that has all of the contacts associated company IDs?

 

My example request is:

curl --location --request POST 'https://api.hubapi.com/crm/v3/objects/contact/search?hapikey=API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "filterGroups": [
        {
            "filters": [
                {
                    "operator": "EQ",
                    "propertyName": "associatedcompanyid",
                    "value": "6101168988"
                }
            ]
        }
    ],
    "properties": [
        "email",
    ],
    "limit": 30
}'
0 いいね!
1件の承認済みベストアンサー
dennisedson
解決策
HubSpot製品開発チーム
HubSpot製品開発チーム

Get all contacts search by company not returning ALL contacts

解決

@SJohnson53 , if you are looking to get all contacts associated with a company, I would suggest employing the associations endpoint

元の投稿で解決策を見る

3件の返信
webdew
ガイド役 | Diamond Partner
ガイド役 | Diamond Partner

Get all contacts search by company not returning ALL contacts

解決

Hi @SJohnson53 ,

Kinldy use the below code:

curl --location --request POST 'https://api.hubapi.com/crm/v3/objects/contact/search?hapikey=API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"filterGroups": [
{
"filters": [
{
"operator": "EQ",
"propertyName": "associations.company",
"value": "<companyID>"
}
]
}
],
"properties": [
"email",
],
"limit": 30
}'


Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards. 

0 いいね!
dennisedson
解決策
HubSpot製品開発チーム
HubSpot製品開発チーム

Get all contacts search by company not returning ALL contacts

解決

@SJohnson53 , if you are looking to get all contacts associated with a company, I would suggest employing the associations endpoint

SJohnson53
参加者

Get all contacts search by company not returning ALL contacts

解決

Thanks - this worked - I got the associations then batch read the contacts - cheers!