I have some weird behavior with the Forms API. It seems to decide per form whether the validation information of the email property (at least) should be included. I first thought it differed across portals, but now find that it differs between forms. It does not matter whether I use V1 or V2.
I get this from one of the first forms we ever made in our portal:
{
"validation": {
"blockedEmailAddresses": [],
"name": "email",
"message": "Please enter a valid email address",
"data": "",
"useDefaultBlockList": false
},
"dependentFieldFilters": [],
"labelHidden": false,
"propertyObjectType": "CONTACT",
"name": "email",
"label": "Email",
"type": "string",
"fieldType": "text",
"description": "",
"groupName": "contactinformation",
"displayOrder": 2,
"required": true,
"selectedOptions": [],
"options": [],
"enabled": true,
"hidden": false,
"defaultValue": "",
"isSmartField": false,
"unselectedLabel": "",
"placeholder": ""
}
But this for other forms, including fresh ones in new customer portals:
{
"validation": {
"blockedEmailAddresses": [],
"name": "",
"message": "",
"data": "",
"useDefaultBlockList": false
},
"dependentFieldFilters": [],
"labelHidden": false,
"propertyObjectType": "CONTACT",
"name": "email",
"label": "E-post",
"type": "string",
"fieldType": "text",
"description": "",
"groupName": "contactinformation",
"displayOrder": -1,
"required": true,
"selectedOptions": [],
"options": [],
"enabled": true,
"hidden": false,
"defaultValue": "",
"isSmartField": false,
"unselectedLabel": "",
"placeholder": ""
}
I cannot for the life of me spot _any_ difference between the forms / fields. Have checked whether changing the label for that second one helped, but it didn’t.
Also, the blocked domains list is excluded from both responses.
Both forms validate nicely, and create an “email” type input when I view the form in HubSpot. (Also think the “type” returned by the API should say “email”)
To me this seems awfully lot like a bug in the API(s)?