APIs & Integrations

PPaduch
Member

Changing the JSON code results in 400 error

SOLVE

Hi Team! 

I copy this Hubspot example code to create a custom object. (I'm using postman) I can create a custom object only with the exact code from the example. The only thing I'm able to change is "name" "singular" and "plural" 

When I try to change the values in the property name, 

primaryDisplayProperty, 
secondaryDisplayProperties or anything else I got 400 error - bad syntax. 
As you can see on the code below I added one extra letter to 
primaryDisplayProperty. When is "model" then everything is fine, but when is "modell" then I got 
"message": "Invalid primary display property: modell"
"subCategory": "ObjectSchemaError.INVALID_PRIMARY_DISPLAY_PROPERTY"


I don't understand why I can change the values in the code. 

Any advice is more than welcome! 

Code: 

 

{
    "name": "Livestorm",
    "labels": {
        "singular": "Livestorm",
        "plural": "Livestorm"
    },
    "primaryDisplayProperty": "modell",
    "secondaryDisplayProperties": [
        "make"
    ],
    "searchableProperties": [
        "year",
        "make",
        "hin",
        "modell"
    ],
    "requiredProperties": [
        "year",
        "make",
        "hin",
        "model"
    ],
    "properties": [
        {
            "name": "condition",
            "label": "Condition",
            "type": "enumeration",
            "fieldType": "select",
            "options": [
                {
                    "label": "New",
                    "value": "new"
                },
                {
                    "label": "Used",
                    "value": "used"
                }
            ]
        },
        {
            "name": "date_received",
            "label": "Date received",
            "type": "date",
            "fieldType": "date"
        },
        {
            "name": "year",
            "label": "Year",
            "type": "number",
            "fieldType": "number"
        },
        {
            "name": "make",
            "label": "Make",
            "type": "string",
            "fieldType": "text"
        },
        {
            "name": "model",
            "label": "Model",
            "type": "string",
            "fieldType": "text"
        },
        {
            "name": "hin",
            "label": "HIN",
            "type": "string",
            "hasUniqueValue": true,
            "fieldType": "text"
        },
        {
            "name": "color",
            "label": "Color",
            "type": "string",
            "fieldType": "text"
        },
        {
            "name": "mileage",
            "label": "Mileage",
            "type": "number",
            "fieldType": "number"
        },
        {
            "name": "price",
            "label": "Price",
            "type": "number",
            "fieldType": "number"
        },
        {
            "name": "notes",
            "label": "Notes",
            "type": "string",
            "fieldType": "text"
        }
    ],
    "associatedObjects": [
        "CONTACT"
    ]
}



 

0 Upvotes
1 Accepted solution
coldrickjack
Solution
Top Contributor

Changing the JSON code results in 400 error

SOLVE

Hey @PPaduch,

 

You have two typos in your code. The first is where you define the primary display property below, you are using "modell" when it should be "model" based on how you've defined the object properties.

 

 "primaryDisplayProperty": "modell",

The second is where you define your searchable properties, again you have "modell" but you should have "model":

 

"searchableProperties": [
"year",
"make",
"hin",
"modell"
]

You need to ensure that you are using the "name" of the property you've defined below which is "model"

 

{
"name": "model",
"label": "Model",
"type": "string",
"fieldType": "text"
}

 

View solution in original post

2 Replies 2
PPaduch
Member

Changing the JSON code results in 400 error

SOLVE

@coldrickjack thank you so much! That worked. I'm new to this and this one post explains a lot! 🍺

0 Upvotes
coldrickjack
Solution
Top Contributor

Changing the JSON code results in 400 error

SOLVE

Hey @PPaduch,

 

You have two typos in your code. The first is where you define the primary display property below, you are using "modell" when it should be "model" based on how you've defined the object properties.

 

 "primaryDisplayProperty": "modell",

The second is where you define your searchable properties, again you have "modell" but you should have "model":

 

"searchableProperties": [
"year",
"make",
"hin",
"modell"
]

You need to ensure that you are using the "name" of the property you've defined below which is "model"

 

{
"name": "model",
"label": "Model",
"type": "string",
"fieldType": "text"
}