Custom contact property not returned by API


#1

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?


#2

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

#3

Hi @dadams

Great, exactly what I needed.

Tanks