API error when sends special characters


#1

I am invoking the API to create a new company (https://api.hubapi.com/companies/v2/companies??hapikey=...) sending a JSON with company properties like this:

{
"properties": [{
"name": "name",
"value": "Company dummy"
},
....
{
"name": "origen_contacto",
"value": "Puerta fría"
},
....
]
}

But an erros has been generated, indicating that 'origen_contact' value (list of values into HubSpot column) is not valid:

{
"status": "error",
"message": "Property values were not valid",
"correlationId": "8daa5cb3-f99d-489a-914e-da4ce3637dae",
"validationResults": [{
"isValid": false,
"message": "Puerta fría was not one of the allowed options: [label: "Puerta Fr\303\255a"
value: "Puerta Fr\303\255a"
display_order: -1
double_data: 0.0
hidden: false
read_only: false
, label: "Prescriptor"
value: "Prescriptor"
display_order: 1
double_data: 0.0
hidden: false
read_only: false
, label: "Redes Sociales / Web"
value: "Redes Sociales / Web"
display_order: 2
double_data: 0.0
hidden: false
read_only: false
, label: "Jornada / Campa\303\261a Comercial"
value: "Jornada / Campa\303\261a Comercial"
display_order: 3
double_data: 0.0
hidden: false
read_only: false
, label: "Contacto Personal"
value: "Contacto Personal"
display_order: 4
double_data: 0.0
hidden: false
read_only: false
, label: "Otro"
value: "Otro"
display_order: 5
double_data: 0.0
hidden: false
read_only: false
, label: "Desconocido"
value: "Desconocido"
display_order: 6
hidden: false
read_only: false
]",
"error": "INVALID_OPTION",
"name": "origen_contacto"
}],
"requestId": "c3d21bc7909ab7f906af0a806c62e866"
}

Please, how do I have to send JSON special characters using API?

Thank you

Jose Luis


#2

Hi @Jose_Luis_Alvarez,

Is Puerta fría the internal name of the property option, or is it the label? Can you give you Hub ID so I can take a look at the property definition?


#3

Hi @Derek_Gervais.

After all, I changed all internal values to numeric sequence (0, 1, 2, 3, ...). No words, no problem!

Thank you.
JL