Can't Get Response Body from Modal Form

Please read this before posting

  • If you received an error from the API that you’re looking for help with, please include the error in your post and be descriptive of the requests you made that received the errors. To be clear, we need the error in the JSON response from the API, not the error your code raised.
  • Do not share any API credentials. Please check that the code you’re pasting into the post does not contain any real OAuth tokens or personal access tokens. If you have exposed credentials, you should revoke them immediately.

Hello I’m trying to add a modal form, and I’m not able to get anything in the response body when I submit the form.

let json_form = {
“metadata”: {
“fields”: [
{
“error”: “Please review and change your input”,
“id”: “single_line_text_field_1”,
“is_required”: true,
“is_watched”: true,
“name”: “Resource name”,
“placeholder”: “Enter the full title of the resource here”,
“type”: “single_line_text”,
“value”: “Annual Kick-Off Meeting”,
“width”: “full”
}
],
“submit_button_text”: “Submit This”,
“title”: “Y Mortgage”,
“on_submit_callback”: “https://secure-everglades-50759.herokuapp.com/submitmodal”,
“on_change_callback”: “https://secure-everglades-50759.herokuapp.com/changemodal
},
“template”: “form_metadata_v0”
}

app.get(‘/asanamodal’, (req,res) => {

res.json(json_form)
})

app.post(‘/submitmodal’, (req,res) => {
console.log(“Form Submitted!”)
console.log(req.body)

let attachment_response = {
resource_name: “I’m an Attachment”,
resource_url: “https://ymtg.ca/wp-content/uploads/2023/06/istockphoto-1322842973-612x612-1.jpg
}
res.json(attachment_response)
})

The form also shows like it’s still loading something when I submit.

image

I think I’m just missing something. I also don’t understand why my only response option is to add an attachment to the task?