Check for error on webhook submission and return message

Hi,

I’m using the Gravity Form webhook addon to send a submission to an API endpoint. I want to be able to display a message to a user if the submission encounters an error. Would the best way to accomplish this be with using gform_webhooks_post_request - Gravity Forms Documentation? Check the request and then display the error? Does this happen before the confirmation notice is displayed?

Ideally form is submitted, webook is fired, if API returns error display error message to user “Unfortunately an error occurred with your submission.” Otherwise display GF normal notification message.

Thank you for your help.

Best,

Tom

Most add-ons process feeds asynchronously so that they are executed after submission has already completed. Reference Add-On Support for Background Feed Processing. If you’d like to handle form submission or confirmation based on the webhook request, you would first need to use gform_is_feed_asynchronous in order to disable this default behavior for the feed. Depending on your result, you could then hook to gform_confirmation to filter the confirmation.

Hi Joshua,

Thank you for the response. Just so I’m clear on this you recommend:

  1. Since the webhook addon fires asynchronously I should first disable this using gform_is_feed_asynchronous. Are there any downsides to doing this?

  2. Once this is disabled will the confirmation message displayed to a user be displayed after the webhook is fully complete (including the response being returned)? If so, I can then fetch the response and display a message depending on the status code using gform_confirmation filter?

Thank you for the clarification