APIs & Integrations

entrance_an
Member

Contact list (via API) doesn't updates after contact modification

SOLVE

Hello!
I had an issue, very similar to

We have a static list that is populated via an API call. Prior to populating it is necessary for us to delete the Contacts within the list previously. After looking through the API docs, it seems the only way is to Get contacts in that list (https://api.hubapi.com/contacts/v1/lists/XXX/contacts/all?hapikey=XXX) and then Remove contacts from the list (https://api.hubapi.com/contacts/v1/lists/XXX/remove?hapikey=XXX). After noticing some issues I began debugging the code and I realized that ev…

My issue is:
1.Get list of all contacts with associated companies.
https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=XXX-XXX-XXX&count=100&property=ema...

2.Remove some contacts from companies:
DELETE method:
https://api.hubapi.com/companies/v2/companies/123456/contacts/654321

3.Do step 1 to get updated list

Expected result:
Getting contact list without assotiated companies from strep 2

actual result:
Contacts in contact list still assotiated with companies from step 2

Note: in UI contacts really detached from companies, but in API i’m still get connected version

0 Upvotes
1 Accepted solution
entrance_an
Solution
Member

Contact list (via API) doesn't updates after contact modification

SOLVE

This is was my mistake.
When i received list of contacts, i, got “Company” field from contact record to get associated company id.
But “Company” field - just single line text field of contact (it was filled durind contact import via API), so every time received the same.
The correct field to get company contact attached is “associatedcompanyid”, but is not described clearly in API doc.
So this topic can be closed.

View solution in original post

2 Replies 2
entrance_an
Solution
Member

Contact list (via API) doesn't updates after contact modification

SOLVE

This is was my mistake.
When i received list of contacts, i, got “Company” field from contact record to get associated company id.
But “Company” field - just single line text field of contact (it was filled durind contact import via API), so every time received the same.
The correct field to get company contact attached is “associatedcompanyid”, but is not described clearly in API doc.
So this topic can be closed.

Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Contact list (via API) doesn't updates after contact modification

SOLVE

Hi @Anton_Nemchenkov,

Can you send me a link to the list you’re referring to, and an example contact that appears disassociated in the UI but not via the API?

0 Upvotes