I have a custom object that has an association to HubSpot’s company object. I’m wondering if there is a way to have the search api return a property of the company when searching the custom object.
For example, I’m searching for all custom objects with the last name of “Smith” and I would like to return some of the properties of the custom object as well as the name of the company that the custom object is associated with.
Search: last_name EQ Smith
Return:
first_name: Joe
use the Search API to return the associated company property when searching for custom objects in HubSpot. To achieve this, you’ll need to specify the “properties” parameter in your API request and include the name of the association property, followed by the name of the company property you wish to return.
Here’s an example of what the API request might look like:
In this example, replace <your_api_key> with your HubSpot API key, custom-objects with the name of your custom object, association_property_name with the name of the association property that links the custom object to the company object, and company_property_name with the name of the company property you want to return.
With this API request, you should be able to retrieve custom objects with the last name of “Smith” and include the associated company’s name in the response. Note that you may need to adjust the parameter names and values to match your specific use case.