Property_doesnt_exist


#1

Hi guys,

I did a quick search for this error message and couldn’t find anything of use.

I’m doing a post to: POST https://api.hubapi.com/companies/v2/companies?hapikey=[redacted]&portalId=[redacted]
with the body

{    "properties": [    {    "property": "name",    "value": "Compananay"    }    ]    }

Expecting this to create a new Company called ‘Compananay’ but the error message returned was:
{
“status”: “error”,
“message”: “Property values were not valid”,
“correlationId”: “[redacted]”,
“validationResults”: [
{
“isValid”: false,
“message”: “Property “” does not exist”,
“error”: “PROPERTY_DOESNT_EXIST”,
“name”: “”
}
],
“requestId”: “[redacted]”
}

I was following the documentation here - expecting a companyId to be returned.
http://developers.hubspot.com/docs/methods/companies/create_company.

Anything look obviously wrong here?


#2

Hi @joeatinspire

The Companies API uses "name" for the property name, not "property"

{
  "properties": [
    {
      "name": "name",
      "value": "Compananay"
    }
  ]
}

#3

Oh! What a simple oversight.
Is the syntax you posted correct?
“name”: “name”
“value”: “company name here”

Or just “name”: “company name here”?


#4

You’ll need to include both the name and the value as separate entries:

{
  "properties": [
    {
      "name": "name",
      "value": "company name here"
    },
    {
      "name": "company_property_name",
      "value": "a value for that property"
    },
    {
      "name": "another_company_property",
      "value": "a different value"
    }
  ]
}

#5

Thanks for your help dadams!