How do I get the associated company of a contact


#1

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


#2

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.


#3

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