APIs & Integrations

Superbytes
Member

CompanyAPI Custom Property not showing correct value

Hi,

 

We created sveral custom properties, one of them is inlumi_service_manager in Companies. This property should contain the name of the person who is the service manager for this company (client).

 

When retrieving the Companies with the addition "&properies=inlumi_service_manager" it does show up correctly, but with the wrong value. It appears to use the "Company Owner" (internal name hubspot_owner_id) values. In the web, it does show correctly. Same if I retrieve a single company by it's ID.

 

For testing puposes I used:

- PowerShell (Invoke-RestRequest)

- Excel (Retrieve Data from Web)

- PowerBI

 

All with the same result.

0 Upvotes
4 Replies 4
Superbytes
Member

CompanyAPI Custom Property not showing correct value

Reading it back, this could be confusing:

"Same if I retrieve a single company by it's ID."

 

I meant, it has the same issue 😉

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

CompanyAPI Custom Property not showing correct value

Hi @Superbytes,

 

I hope all is well with you 😄

 

When looking to retrieve company data using the Get a Company | Companies API or Get all companies, the value return would be showing the internal value of the properties instead of the label. 

 

I took a look into your portal 4113293 and went to your companies properties settings (Click on the settings tool at the top right > On the side panel, click 'Properties' > Select 'Company properties' > Search for 'inlumi Service Manager' > You'll see that each label has an internal value) and I'm able to see that the label and internal value are different and so I believe that was the confusing factor:

- The HubSpot portal UI would show the label.

- However, the API would return the internal value.

 

As the field type 'HubSpot user' is non editable, if you'd like to see the label using API, I'd suggest for you to change the field type to drop down list and set your own internal value for each user option.

 

Additionally, you can also use this endpoint: Get an Owner | Owners API to get the user details by plucking in the internal value.

 

I hope this helps to further clarify things!

0 Upvotes
Superbytes
Member

CompanyAPI Custom Property not showing correct value

Hi WendyGoh,

 

Thank you for your explenation and suggestions. I am using only internal names, not labels. However I am not sure the issue is with showing the property. When I query a company or all companies, the propert does how with the following result (anonymized):

 

inlumi_service_manager: @{value=32172476; timestamp=1541672277478; source=CRM_UI; sourceId=wrong.name@inlumi.com; versions=System.Object[]}

 

In the web, it shows right.name@inlumi.com.

 

Looking at the values returned by the API for each company, I have to conclude the API is returning (internal names) "hubspot_owner_id" instead of the value belonging to "inlumi_service_manager".

 

Not sure how changing the field to "dropdownlist" would solve this issue.

 

Other custom properties seem to work as intended in the API.

 

Many thanks in advance!

 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

CompanyAPI Custom Property not showing correct value

Hi @Superbytes,

 

By label I mean the dropdown options labels like this:

HubSpot user.png

 

 I have also created a hstest.com company test domain and you can see the visual explanation here:

relationship.png

 

I hope this helps to further explan things.

0 Upvotes