APIs & Integrations

rainsfordt
Member

How do I get the associated company of a contact

SOLVE

Hi,

I really need the associated CompanyID of a contact. I read in a few places it is 'properties=associatedcompanyid' however, I can't seem to get anything returned for it even though I have linked a contact to a company in HubSpot itself.

Dim result = APICall(String.Format("https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey={0}&properties=associatedcompanyid&properties=deleted&count={1}", hapikey, offset))

Dim jObject As JObject = JObject.Parse(result)

Here is the proof it should be associated as it is in HubSpot: https://imgur.com/a/SmbImiK

Am I missing something?

Any questions or if I don't make sense let me know :slight_smile:

Thanks

0 Upvotes
1 Accepted solution
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

How do I get the associated company of a contact

SOLVE

Hi @rainsfordt,

If you're pulling contacts using the 'Get all contacts' endpoint (/contacts/v1/lists/all/contacts/all) you'll need to change the query parameter you're using a bit. It should look like the following:

property=associatedCompanyId

View solution in original post

2 Replies 2
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

How do I get the associated company of a contact

SOLVE

Hi @rainsfordt,

If you're pulling contacts using the 'Get all contacts' endpoint (/contacts/v1/lists/all/contacts/all) you'll need to change the query parameter you're using a bit. It should look like the following:

property=associatedCompanyId
rainsfordt
Member

How do I get the associated company of a contact

SOLVE

Further to this, I have read the documentation here: https://developers.hubspot.com/docs/methods/companies/companies-overview and both options aren't really a solution for me as per my above note on this topic.

I could really do with a response on this asap or some help, as I need to get the associated company/contact IDs from a GET request.

0 Upvotes