APIs & Integrations

yeti_t
Member

How can I return all contact properties with a value?

SOLVE

am using the CRM API to fetch a contact. I would like to get the contact returned with all properties (including non-default properties) that have a value set.

If you perform GET /crm/v3/objects/contacts/{contactId}, it says to "Control what is returned via the properties query param" but this means I need to know what properties exist on the contact.

If you don't pass the properties query param, you end up getting back first/last name and email, but you don't get all properties that have a value.

Anyone in here know if you can accomplish what I want?

1 Accepted solution
malcolm1
Solution
Member | Gold Partner
Member | Gold Partner

How can I return all contact properties with a value?

SOLVE

The API is designed to return the properties that you specify.  You can experiment with the query on this page: https://developers.hubspot.com/docs/api/crm/contacts. From the Endpoints selector menu, choose READ. That will scroll down to that part of the page. You can look at the "parameters" section of the notes for "properties". In that section play with the "Add test Value" tool. Notice that the example request gets modified to reflect the additions that you've made. The tool generates code for cURL, Python, PHP, etc, so select the code type that you want and you'll get a working example. 

View solution in original post

5 Replies 5
SKumar4547
Member

How can I return all contact properties with a value?

SOLVE

Hey @malcolm1 , what if there are custom fields. How would I access them? As per my requirements, I have to connect with multiple HubSpot accounts and I don't know the exact property name(customer field). My end user will map the exact property. Is it not possible to list down all the properties with values?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How can I return all contact properties with a value?

SOLVE

@SKumar4547 

You will query the properties endpoint as I mentioned above to get comprehensive list of all available properties

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How can I return all contact properties with a value?

SOLVE

@yeti_t , If you need a list of all available properties, you can also hit this endpoint

malcolm1
Solution
Member | Gold Partner
Member | Gold Partner

How can I return all contact properties with a value?

SOLVE

The API is designed to return the properties that you specify.  You can experiment with the query on this page: https://developers.hubspot.com/docs/api/crm/contacts. From the Endpoints selector menu, choose READ. That will scroll down to that part of the page. You can look at the "parameters" section of the notes for "properties". In that section play with the "Add test Value" tool. Notice that the example request gets modified to reflect the additions that you've made. The tool generates code for cURL, Python, PHP, etc, so select the code type that you want and you'll get a working example. 

natsumimori
Community Manager
Community Manager

How can I return all contact properties with a value?

SOLVE

Hi @MatthewShepherd and @malcolm1 , do you have experience in this topic??