APIs & Integrations

jdevasconcelos
Member

Create Contact with checkbox options in custom property

SOLVE

I have a custom property defined to my contacts. This property have some possible options (checkboxes). When I try to create a new contact using API, the contact is created but without the custom properties.

The documentation is not specific about how to populate this fields. I did try some combinations of arrays to do that but without success.

Someone can help me?

0 Upvotes
1 Accepted solution
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Create Contact with checkbox options in custom property

SOLVE

Hi @jdevasconcelos, you should be able to write to a custom property using the contacts API. For a field that accepts multiple options (multiple checkbox), you can separate values with a ;. Here's an example request I made to my own Account:

{
   "properties":[
      {
         "property":"email",
         "value":"testingapis+123@hubspot.com"
      },
      {
         "property":"profession_check",
         "value":"interiordesigner; architect"
      }
   ]
}

And here's the contact:

View solution in original post

0 Upvotes
2 Replies 2
jdevasconcelos
Member

Create Contact with checkbox options in custom property

SOLVE

@Connor_Barley thank you! Works fine!

cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Create Contact with checkbox options in custom property

SOLVE

Hi @jdevasconcelos, you should be able to write to a custom property using the contacts API. For a field that accepts multiple options (multiple checkbox), you can separate values with a ;. Here's an example request I made to my own Account:

{
   "properties":[
      {
         "property":"email",
         "value":"testingapis+123@hubspot.com"
      },
      {
         "property":"profession_check",
         "value":"interiordesigner; architect"
      }
   ]
}

And here's the contact:

0 Upvotes