REST API - Field name differences between form description and submitForm
Hello,
I am trying to submit forms from backend (REST API). But I am facing a weird behavior related to the field namings. When I access the "fields.json" endpoint for a specific form, one of the fields I receive is "Email":
{
"id": "Email",
"label": "E-mail Address",
"dataType": "email",
"validationMessage": "Must be valid email. <span class='mktoErrorDetail'>example@yourdomain.com</span>",
"rowNumber": 0,
"columnNumber": 0,
"required": true,
"formPrefill": true,
"visibilityRules": {
"ruleType": "alwaysShow"
}
}
But when I try to upsert a lead using the submitForm.json endpoint using the same specific form, I cannot update/insert the lead unless I use the "email" field, and not the "Email" field.
This does not work (Field 'Email' not found in form definition):
{
"input":
[
{
"leadFormFields":
{
"Email": "example@example.com"
}
}
],
"formId":"2509"
}
This works:
{
"input":
[
{
"leadFormFields":
{
"email": "example@example.com"
}
}
],
"formId":"2509"
}
Am I doing something wrong, considering that other fields that are mentioned in the fields.json are updated correctly in submitForm?
Thank you.