APIs & Integrations

yeti_t
Mitglied

How can I return all contact properties with a value?

lösung

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 Akzeptierte Lösung
malcolm1
Lösung
Mitglied | Gold Partner
Mitglied | Gold Partner

How can I return all contact properties with a value?

lösung

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. 

Lösung in ursprünglichem Beitrag anzeigen

5 Antworten
SKumar4547
Mitglied

How can I return all contact properties with a value?

lösung

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-Produktteam
HubSpot-Produktteam

How can I return all contact properties with a value?

lösung

@SKumar4547 

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

0 Upvotes
dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

How can I return all contact properties with a value?

lösung

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

malcolm1
Lösung
Mitglied | Gold Partner
Mitglied | Gold Partner

How can I return all contact properties with a value?

lösung

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/-in
Community-Manager/-in

How can I return all contact properties with a value?

lösung

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