I'm using PHP to POST form data to HubSpot Forms API. Everything works fine - submitted form data is stored in HubSpot correctly except enumeration fields.
I'm sending form data from my front-end APP to my backend APP and receives all data as an array in following structure:
[ 'firstname' => ..., 'lastname' => ..., 'email' => ..., 'some_enumeration_field' => [ 'Value 1', 'Value 2', ... ] ]
Than I'm using PHP CURL to send this data further into HubSpot API. I'm using code almost exact the same as shown in API examples. Only difference is that I'm using
http_build_query function to parse array. But there is problem with enumaration fields, which are sub-arrays. In my submission details enumeration field values has exclamation icons next to them. And the key names are bad, they are stored this way:
some_enumeration_field_0_ : 'Value 1' some_enumeration_field_1_ : 'Value 2'
Hovering the exclamation icon gives me following error:
"This value wasn't passed to the contact record. 'some_enumeration_field_0_' isn't a contact property."
So how to send enumeration data to HubSpot API properly that it will be recognised as an array of values?