How to show response successful message for 204 status


#1

Hi I have used the submit data to the form API.

https://developers.hubspot.com/docs/methods/forms/submit_form the POST data successfully passed to HubSpot list need to show a success message while posting the data. Now no content on body.

How to so any content while posting the data.


#2

Hi @Venkatesh_Srikanth,

I'm not sure I'm clear on the issue you're describing; a 204 No Content is the expected success response for this endpoint; if you receive a 204, you can assume that the form submission was accepted. What is the data that you need?


#3

On the body part need some text like Success / Failed messages.


#4

If Posting same email same contact also return 204 status it does't show the contact already exists. How to show different status ?

  1. Already Exists
  2. Error
  3. Invalid email
  4. Success

#5

Please response something


#6

Hi @Venkatesh_Srikanth,

The form submission endpoint doesn't give you any information if the submission is successful; whether or not the contact exists doesn't affect the response. The response from the form submission endpoint can be any of the following:

  • 204 when the form submissions is successful
  • 302 when the form submissions is successful and a redirectUrl is included or set in the form settings.
  • 404 when the Form GUID is not found for the provided Portal ID
  • 500 when an internal server error occurs