Company Contacts

Hi,

We’re querying recently Modified Contacts for an integration. Is it possible to get the ID of the company the contact is associated to?

Contacts with no Company association will be ignored as the target system is built and used that way.

Hi @itzco,

Yes this would be possible. That “Get recently updated and created contacts” endpoint allows you to request certain properties from HubSpot using the optional “property” parameter. You could make a request like this to return the email, first name, last name and associated company ID of a contact in the CRM:

https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?hapikey={{apikey}}&count=2&property=email&firstname&property=lastname&property=associatedcompanyid

This would return something like below:

 "contacts": [
 {
 "addedAt": 1578480081599,
 "vid": 294701,
 "canonical-vid": 294701,
 "merged-vids": [],
 "portal-id": 2990812,
 "is-contact": true,
 "profile-token": "AO_T-mMaIWKxqXUapU2s-1VFpOSikPUthlmFxYLzBu0iHSqduTyR2XDE7j8NXFC96IIaPgZHvLPcFKZRPT4LZQY62tcnHBP1LyoSbUeUYWMSPaDrGI6Jusb6WWTcuygOhrAC3PyeEHOl",
 "profile-url": "https://app.hubspot.com/contacts/2990812/contact/294701",
 "properties": {
 "firstname": {
 "value": "Jack"
 },
 "associatedcompanyid": {
 "value": "496959780"
 },
 "lastmodifieddate": {
 "value": "1578480081599"
 },
 "email": {
 "value": "jackcoldrick@hubspot.com"
 },
 "lastname": {
 "value": "Coldrick"
 }
 }

I hope this helps,

Jack

Thanks @jackcoldrick I couldn’t find that in the API documentation. It would be great if the documentation will also mention the way properties have to be requested (one property entry for each).