Hubspot adding "BOOLEAN" dataType to propertyDefinitions in Object Type

Here’s a sample response when getting my Object type via the API

{"id":98242,"applicationId":191360,"baseUris":[],"dataFetchUri":"xxx","title":"Test Data","propertyDefinitions":[{"dataType":"BOOLEAN","name":"total_calls","label":"Total Calls","dataType":"NUMERIC"},{"dataType":"BOOLEAN","name":"connected_calls","label":"Connected Calls","dataType":"NUMERIC"},{"dataType":"BOOLEAN","name":"total_notes","label":"Total Notes","dataType":"NUMERIC"},{"dataType":"BOOLEAN","name":"total_emails","label":"Total Emails","dataType":"NUMERIC"}],"associatedHubSpotObjectTypes":["CONTACT"],"associatedHubSpotObjectTypeProperties":{"CONTACT":["associatedObjectId","associatedObjectType"]}}

Each propertyDefinition contains 2 dataTypes. I have tried modifying the Object Type from their website and via the Modify Object type API but the BOOLEAN datatype is still added somehow.

Welcome, @jvdesu.

Apologies for the delayed response.

That’s strange, indeed. Are you still encountering this behavior?

I haven’t been able to replicate the issue. When I call extensions/sales-objects/v1/object-types/98242, I receive the following:

{
id:98242,
applicationId:191360,
baseUris:[ ],
dataFetchUri:"xxx",
title:"Test Data",
propertyDefinitions:[
{
dataType:"NUMERIC",
name:"total_calls",
label:"Total Calls"},
{
dataType:"NUMERIC",
name:"connected_calls",
label:"Connected Calls"},
{
dataType:"NUMERIC",
name:"total_notes",
label:"Total Notes"},
{
dataType:"NUMERIC",
name:"total_emails",
label:"Total Emails"}],
associatedHubSpotObjectTypes:["CONTACT"],
associatedHubSpotObjectTypeProperties:{
CONTACT:[
"associatedObjectId",
"associatedObjectType"]}}

Thank you for replying @IsaacTakushi !

Yes I am still having this error,

https://api.hubapi.com/extensions/sales-objects/v1/object-types/98242?hapikey=

Hi, @jvdesu.

Please don’t include your API key in posts on this public forum. I’ve edited the key out of your last message.

I am still not getting those results… I clicked the link you provided and the following GET request rendered in my browser:

How are you making these requests? Can you send me a screenshot of the response in your browser or in a REST client? (Please redact all sensitive information.)

Thank you @IsaacTakushi,

We’ve just realized that the bug only occurs when openning the link in Chrome but not in firefox.

Our real problem is that we’re getting a Response deserilization error and I’m only guessing that this is the one causing it. I’ve posted another question here

https://community.hubspot.com/t5/APIs-Integrations/Response-deserialization-error/m-p/261927

Thank You!

Hey, @jvdesu.

I’ve been able to reproduce this behavior in Chrome Incognito mode with my JSON viewer extensions disabled:

This seems to be more of a quirk with data formatting than an issue with HubSpot’s APIs.

JSON viewers and REST clients remove the "dataType":"BOOLEAN" field. In Firefox, for example, you can compare the results of the Raw Data tab:

to those in the JSON tab:

To this point, I’ve been seeing formatted JSON responses and those in REST clients.

I do not believe this formatting inconsistency is causing the “Response deserialization” error you report in this post, however.

When I retrieve an object type from my colleague @cbarley’s account, the "dataType":"BOOLEAN" field also appears in Chrome Incognito results, but does not trigger “Response deserialization” errors in his app:

You are right @IsaacTakushi, this wasn’t the cause of the “Deserialization error” but due to the contents of my CRM response. Your solution on the other post has fixed it.

Thank You for helping!

So glad I could help, @jvdesu!