APIs & Integrations

TomT
Mitglied

Custom contact property not returned by API

I’m retrieving contacts by company id with the following URL: https://api.hubapi.com/companies/v2/companies/ mycompanyId/contacts?hapikey=xxxxxxxxxx&portalId=xxxxxxx. However, our custom contact parameters (‘role’ and ‘support_contact’) are not returned even if they contain a value.

I did check and the custom properties have been created in HubSpot. The properties are returned when using the 'Get all properties request (https://api.hubapi.com/properties/v1/contacts/properties?hapikey=xxxxxx&portalId=xxxxxxx) and are visible in the HubSpot portal but not in the returned JSON of the above call. Is there anything I’m missing here?

0 Upvotes
2 Antworten
TomT
Mitglied

Custom contact property not returned by API

Hi @dadams

Great, exactly what I needed.

Tanks

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Custom contact property not returned by API

Hi @TomT

By default you only get a few default properties for the contacts. You can add &property={property name} to request specific properties to be included in the response. You can include the parameter multiple times to get multiple specific properties, just keep in mind that if you include any properties using that parameter that you will only get the specified properties (so you’ll only get the firstname and lastname if you also include those properties in addition to any other properties).

/companies/v2/companies/14074638/contacts?hapikey=xxxx&property=customproperty&property=firstname&property=lastname