500 Internal server error

I have a form that submits successfully, but immediately throws a an error that in the console shows as 500 internal server error.

Now, this is happening whilst form submissions are successful and I can see them in the admin. None of the other actions on the form are working.

bricksforge/v1/form_submit 500 (Internal Server Error)
runRequests @ bricksforge_elements.js:1
await in runRequests
(anonymous) @ bricksforge_elements.js:1
await in (anonymous)
submitForm @ bricksforge_elements.js:1
(anonymous) @ bricksforge_elements.js:1
bricksforge_elements.js:1 SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

When I load the page with the form (includes form step), there is a console error already waiting:

3792146/bricksforge/v1/render_form_data 401 (Unauthorized)
runRequests	@	bricksforge_elements.js:1
await in runRequests		
renderFormData	@	bricksforge_elements.js:1
(anonymous)	@	bricksforge_elements.js:1
await in (anonymous)		
handleForm	@	bricksforge_elements.js:1
init	@	bricksforge_elements.js:1
BrfProForms	@	bricksforge_elements.js:1
(anonymous)	@	bricksforge_elements.js:1
brfInitProForms	@	bricksforge_elements.js:1
(anonymous)	@	bricksforge_elements.js:1
setTimeout		
(anonymous)	@	bricksforge_elements.js:1

Okay. I was close to pulling my hair, then heaven stepped in.

The issue(s):

  1. add field.your_unique_name to the JSON data fields
  2. Somehow, if you have secured your WP API endpoint, you need to add authorization to your webhook headers. This is why I was getting the internal 500 server error
  3. There could be other issues but I’m too happy to care right now. It works.