Getting one custom property for a company

Hi,

As the subject says, I’m trying to get one of the custom properties for a company in our instance of HubSpot. I’ve found what I thought would be solutions in the forums, but I can’t seem to get it working. I can get the company with this endpoint: “https://api.hubapi.com/crm/v3/objects/companies/{companyid}”, but when I add a query string, such as “?property=Kegworks_NetSuite_Companies-1”, that property isn’t returned (I also tried ‘Kegworks_Companies_Export_With_Owners-1’ just in case). I’m guessing that could be the wrong name for the property, but at this point, I don’t know and can’t figure out how to check it. Any help would be greatly appreciated.

Hi @JNichel

Your query parameter should be properties not proerty e.g.

https://api.hubapi.com/crm/v3/objects/companies/{companyid}?**properties**=Kegworks\_NetSuite\_Companies-1

Have fun

Mike

Hi Mike. Thank you for the reply. Sorry, I should have mentioned that I’ve tried both properties and property. I know the docs say properties, but I found a forum post where someone listed it as property, so I gave that a shot. For the record, when I use ‘properties’, it returns this:

[properties] => stdClass Object
 (
 [createdate] => 2021-02-05T21:45:42.697Z
 [hs_lastmodifieddate] => 2023-07-05T18:10:30.650Z
 [hs_object_id] => 5309726888
 )

And when I use ‘property’, it has the basic company info:

[properties] => stdClass Object
 (
 [createdate] => 2021-02-05T21:45:42.697Z
 [domain] => xxxxxx-xxxxxxxx.net
 [hs_lastmodifieddate] => 2023-07-05T18:10:30.650Z
 [hs_object_id] => 5309726888
 [name] => xxxxxx xxxxxxxx By xxxxxxx xxxxxxxx

Hi @JNichel

Thanks for the extra info – the next thing I’d check is your capitalisation. HubSpot typically makes everything lowercase with underscores for spaces.

So, to check this go to your properties in HubSpot – Settings (cog top right) > Properties (Left menu).

Click on the Property you want to open the slide in panel and then click on the “< />”. You will see the variable name HubSpot has assigned to the property. My assumption is it will be lowercase.

In this example “Temporary Order ID” is temporary_order_id.

Did that work?

Mike, thank you so much. That worked perfectly. Not to mention the fact that I now know where to go the next time I need to pull data from a different property. Thank you again!

Great to hear!