APIs & Integrations

joeatinspire
Member

Property_doesnt_exist

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?

0 Upvotes
4 Replies 4
Dadams
HubSpot Employee
HubSpot Employee

Property_doesnt_exist

Hi @joeatinspire

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

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

Property_doesnt_exist

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

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

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Property_doesnt_exist

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"
    }
  ]
}
0 Upvotes
joeatinspire
Member

Property_doesnt_exist

Thanks for your help dadams!

0 Upvotes