APIs & Integrations

gangeld
Member

Form API returns no validation

Hi,

 

we are trying to use https://developers.hubspot.com/docs/methods/forms/v2/get_form API.

 

I've setup the form in our accoutn and we are able to get the response.

 

However the validation parts are empty in the response:

"fields": [
{
"name": "firstname",
"label": "Vorname",
"type": "string",
"fieldType": "text",
"description": "",
"groupName": "contactinformation",
"displayOrder": -1,
"required": false,
"selectedOptions": [],
"options": [],
"validation": {
"name": "",
"message": "",
"data": "",
"useDefaultBlockList": false,
"blockedEmailAddresses": []
},
"enabled": true,
"hidden": false,
"defaultValue": "",
"isSmartField": false,
"unselectedLabel": "",
"placeholder": "",
"dependentFieldFilters": [],
"labelHidden": false,
"propertyObjectType": "CONTACT",
"metaData": []
},
{
"name": "lastname",
"label": "Nachname",
"type": "string",
"fieldType": "text",
"description": "",
"groupName": "contactinformation",
"displayOrder": -1,
"required": false,
"selectedOptions": [],
"options": [],
"validation": {
"name": "",
"message": "",
"data": "",
"useDefaultBlockList": false,
"blockedEmailAddresses": []
},
 
These are required fields and so where can I set the message text for that?
 
Thank you!
0 Upvotes
4 Replies 4
himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Form API returns no validation

Hello @gangeld 

 

Try using the feature to customize the forms How to customize the form embed code. It allows to set internal messages to show up on form submissions.

 

Thanks

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
gangeld
Member

Form API returns no validation

 

Hi @himanshurauthan ,

But we are integrating the API with angular, and we could show up the errors even before form submit.

But right now it's impossible to get the error messages and validations.

0 Upvotes
himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Form API returns no validation

@gangeld 

 

are you using Global form events?
Try to use this on form submit event and submit the form data at same time. See if we get error messages regarding form validations there

 

Thanks

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
gangeld
Member

Form API returns no validation

@himanshurauthan in this case hubspot is not allowing client side input validation at all which is really bad and wrong API design....

0 Upvotes