APIs & Integrations

RSmithson
Member

Python API: unable to update properties with spaces in them

SOLVE

Hi,

 

I'm using the Hubspot Python API with an API key (as I don't intend on publishing anything, just using our own data).

 

Whenever I try and create a contact using property names that have spaces in them, I get errors.

 

See:

HTTP response body: {"status":"error","message":"Property values were not valid: [{\"isValid\":false,\"message\":\"Property \\\"postal code\\\" does not exist\",\"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"postal code\"},{\"isValid\":false,\"message\":\"Property \\\"phone number\\\" does not exist\",\"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"phone number\"},{\"isValid\":false,\"message\":\"Property \\\"last name\\\" does not exist\",\"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"last name\"},{\"isValid\":false,\"message\":\"Property \\\"first name\\\" does not exist\",\"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"first name\"},{\"isValid\":false,\"message\":\"Property \\\"street address\\\" does not exist\",\"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"street address\"},{\"isValid\":false,\"message\":\"Property \\\"date of birth\\\" does not exist\",\"error\":\"PROPERTY_DOESNT_EXIST\",\"name\":\"date of birth\"}]","correlationId":"55d36eae-0552-4dc8-bf4b-c25d476160f3","category":"VALIDATION_ERROR"}

0 Upvotes
1 Accepted solution
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

Python API: unable to update properties with spaces in them

SOLVE

Hey @RSmithson 

The property name cannot have spaces.  The property label can.  Looks like you are trying to use the label rather than the name

2 ways to get the property name

1:  Do a GET request to this endpoint where objectType would be contacts in this case -- https://api.hubapi.com/crm/v3/properties/objectType?archived=false&hapikey=YOUR_HUBSPOT_API_KEY.  This will print out all propertis for your object.  Search for your specific property and locate the name

2:  You can log into your portal and look at all of the properties in the settings.  Here is a kb on getting there.  See screengrab for location of the property name once you are there

Property_settings.png

Hope this helps!

View solution in original post

0 Upvotes
1 Reply 1
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

Python API: unable to update properties with spaces in them

SOLVE

Hey @RSmithson 

The property name cannot have spaces.  The property label can.  Looks like you are trying to use the label rather than the name

2 ways to get the property name

1:  Do a GET request to this endpoint where objectType would be contacts in this case -- https://api.hubapi.com/crm/v3/properties/objectType?archived=false&hapikey=YOUR_HUBSPOT_API_KEY.  This will print out all propertis for your object.  Search for your specific property and locate the name

2:  You can log into your portal and look at all of the properties in the settings.  Here is a kb on getting there.  See screengrab for location of the property name once you are there

Property_settings.png

Hope this helps!

0 Upvotes