I submitted form data to a HubSpot form using this endpoint.
However, error occurred when the form contains company property.
My form fields are as follows:
・lastname
・firstname
・phone
・name (Company property)
Only “name” which is company name, is company property and the rest are all contact property.
Code is as follows:
const options = {
headers: {
'Message-Type': 'application/json',
},
};
const portalId = 'xxxxx';
const formGuid = 'xxxxx';
const url = `https://api.hsforms.com/submissions/v3/integration/submit/${portalId}/${formGuid}`;
await axios.post(
url,
{
portalId,
formGuid,
fields: [
{
name: 'lastname',
value: 'test1',
},
{
name: 'firstname',
value: 'test2',
},
{
name: 'email',
value: 'test@example.com',
},
{
name: 'phone',
value: 0801234567,
},
{
name: 'name',
value: 'test,Inc',
},
],
},
options,
);
Do I need to do something with “name” property?
Hope someone tells me the way to work it out.