APIs & Integrations

joben
Member

Access custom contact properties with API not working. Please help

With the developer account I can create custom contact properties in the test portal, but when I try to set those properties via the API using the hapi key generated by the developer portal I get an error.

The error I get is the following:

HTTP/1.1 400 Bad Request
Access-Control-Allow-Credentials: false
Content-Type: application/json; charset=UTF-8
Vary: Accept-Encoding
Vary: Accept-Encoding
Content-Length: 2217
Date: Mon, 12 Sep 2016 06:44:26 GMT
Connection: close

{“status”:“error”,“message”:“Property values were not valid”,“correlationId”:“82fab259-0bbb-44f6-b9fc-dc2b59feefc1”,“validationResults”:[{“isValid”:false,“message”:“Property “customer_type” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“customer_type”},{“isValid”:false,“message”:“Property “account_number” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“account_number”},{“isValid”:false,“message”:“Property “bankprovideraddress” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“bankprovideraddress”},{“isValid”:false,“message”:“Property “hin” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“hin”},{“isValid”:false,“message”:“Property “bank_provider” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“bank_provider”},{“isValid”:false,“message”:“Property “bank_a_c_” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“bank_a_c_”},{“isValid”:false,“message”:“Property “platform” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“platform”},{“isValid”:false,“message”:“Property “bsb” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“bsb”},{“isValid”:false,“message”:“Property “account_name” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“account_name”},{“isValid”:false,“message”:“Property “designation” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“designation”},{“isValid”:false,“message”:“testLifecycleStage was not one of the allowed options: [label: “Subscriber”\nvalue: “subscriber”\ndisplay_order: 0\n, label: “Lead”\nvalue: “lead”\ndisplay_order: 1\n, label: “Marketing Qualified Lead”\nvalue: “marketingqualifiedlead”\ndisplay_order: 2\n, label: “Sales Qualified Lead”\nvalue: “salesqualifiedlead”\ndisplay_order: 3\n, label: “Opportunity”\nvalue: “opportunity”\ndisplay_order: 4\n, label: “Customer”\nvalue: “customer”\ndisplay_order: 5\n, label: “Evangelist”\nvalue: “evangelist”\ndisplay_order: 6\n, label: “Other”\nvalue: “other”\ndisplay_order: 7\n]”,“error”:“INVALID_OPTION”,“name”:“lifecyclestage”},{“isValid”:false,“message”:“Property “adviser_code” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“adviser_code”}],“requestId”:“720f7c47-166e-4e2d-ae1c-d226e2437ed0”}

So it says that the properties I created does not exist even though I can see and set them in the test portal. It seems that the API tries to create a contact not in the test portal. We need to be able to run tests via the API replicating our “Production” HubSpot environment, so that we can first test whatever we create before releasing it into production.

I look forward to hear from you.

0 Upvotes
3 Replies 3
Dadams
HubSpot Employee
HubSpot Employee

Access custom contact properties with API not working. Please help

Hi @joben

The Developer HAPIkey only works with the developer portal itself, and it’s mostly used for setting up Timeline Events and Webhooks associated with an app. If you’re working with a test portal, you’ll need to get the hapikey for that portal, or authenticate one of those portals with an OAuth app and use an access_token.

0 Upvotes
joben
Member

Access custom contact properties with API not working. Please help

Hi David

Thank you very much for your response. As this is just an internal
integration, we would opt to use the HAPIkey. Could you please direct me
how and where I can get the hapikey for the Test Portal?

Thank you very much!

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Access custom contact properties with API not working. Please help

You can get the API for a portal from the Account Menu > Integrations > Get your HubSpot API Key.

How do I get my HubSpot API key?

Marketing Basic, Professional, and Enterprise customers and portals with a CRM can access the HubSpot API. Learn how to access your HubSpot API key here.

Each test portal will have its own key.

0 Upvotes