APIs & Integrations

itzco
Participant

Company Contacts

SOLVE

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.

0 Upvotes
1 Accepted solution
jackcoldrick
Solution
HubSpot Employee
HubSpot Employee

Company Contacts

SOLVE

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

Jack Coldrick
Solutions Engineer @ HubSpot
Add me on LinkedIn

View solution in original post

2 Replies 2
jackcoldrick
Solution
HubSpot Employee
HubSpot Employee

Company Contacts

SOLVE

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

Jack Coldrick
Solutions Engineer @ HubSpot
Add me on LinkedIn
itzco
Participant

Company Contacts

SOLVE

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).

 

 

0 Upvotes