APIs & Integrations

MRPereira
Member

API Form Submission Error

Hello, I'm trying to post to submit form endpoint submissions/v3/integration/submit/:portalId/:formId but I'm getting a 400 error with this message:

 

 

 

{
   "status":"error",
   "message":"The request is not valid",
   "correlationId":"56817bc0-0e2f-48b6-960a-3462d0c0c7de",
   "errors":[
      {
         "message":"Error in 'fields.produto'. Field 'produto' isn't in form definition",
         "errorType":"FIELD_NOT_IN_FORM_DEFINITION"
      }
   ]
}

 

I've others custom fields and they works fine, just this new one that I'm in trouble.

 

The field exists and I would know if I made something wrong

Property Basic.pngProperty Type.pngProperty Name.png

0 Upvotes
2 Replies 2
advance512
Contributor

API Form Submission Error

We had the same issue.

 

The issue is that Forms behavior changed a few months ago:
https://developers.hubspot.com/changelog/validation-change-to-the-forms-api-submission-endpoints


Before, forms didn't require to add Fields (=properties) to them. If the fields were valid, the forms worked. We had a form with no Fields in it, except for the email, so we had complete flexibility in the dev side. It worked.
After the change, for forms created from March 22 and onwards, you need to include all relevant fields explicitly in the form. 

 

Forms older than March 22 should still work with the previous behavior, this is what Hubspot say.

But for some reason, it won't work with newer fields created after March 22, even if the form is older.
It's like what they said about the granularity is wrong - it's about the date of the fields that are used in the form, not the the date of the form itself.

 

We added the Field to the old Form (marked it as not required) and it worked. All older Fields that were submitted via the Form without being added, still work. Weird.

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

API Form Submission Error

Hi, @MRPereira 👋 Thanks for adding all those details 🙌 @tjoyce @RomanGruit, do you have any thoughts for @MRPereira?

 

Thank you! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes