Custom Contact Properties

Hi, I have a website where people answer random questions. I want through latest API contact creation each question should be created as property name and each answer should be treated as property value.

please note questions are always random and thousands of questions can be asked. Please suggest how can I save multiple Q/A with single contact?

Hello,

You can create properties through the API, and then fill the values.

Here is how you can create a property with the API:

POST https://api.hubapi.com/crm/v3/properties/contact
Authorization: Bearer {{apiToken}}
Content-Type: application/json

{
 "label": "{{question text}}",
 "value": "{{question_text}}",
 "type": "string",
 "fieldType": "text",
 "groupName": "contactinformation",
 "hidden": false,
 "displayOrder": 2,
 "hasUniqueValue": false,
 "formField": true
}

Here is how you can create a contact with the API:

You need to include atleast one of these properties: email, firstname, lastname to avoid duplicates.

And the internal name of the newly created property with the value key.

POST https://api.hubapi.com/crm/v3/objects/contactsAuthorization: Bearer {{apiToken}}Content-Type: application/json{ "properties": { "email": "{{email}}", "{{question_text}}": "{{answer}}" }}

Hope this helps, and if it does, please feel free to mark it as solution, so others can find it more easily. :slightly_smiling_face: