APIs & Integrations

christos_jubile
Member

Fetching company-contact association returns only primary associations

Hello I am using the below python function to fetch all contacts associated with a company

 

def get_associated_contacts(access_token, company_id):
url = f"https://api.hubapi.com/crm/v3/objects/companies{company_id}/associations/contact"
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {access_token}"}
response = requests.request("GET", url, headers=headers)
if response.status_code == 200:
return get_multiple_contacts_with_properties(
access_token, [item["id"] for item in response.json()["results"]], ["email", "contact_type", "notify_"]
)
else:
print(f"Error: {response.status_code}")
return None

 

 

but i realized that it returns only the contacts that have as primary association the company that I am searching can you give me workaround on how to get the secondary assoications?

Regards Christos

0 Upvotes
1 Reply 1
PamCotton
Community Manager
Community Manager

Fetching company-contact association returns only primary associations

Hello @christos_jubile, thank you for posting in our Community!

 

I was able to investigate more and looks like it could be that it can carry all old associations, but 

I would recommend connecting with HubSpot Technical Support, as Support is included in your subscription and they will be able to provide real-time assistance for this matter, including hopping on a screenshare if necessary. 

 

Kindly,

Pam

 

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes