I have setup the REST API in Gravity Forms to accept form submissions. This working as expected, and I am getting the usual 200 success status, with the returned JSON response.
How do I edit that JSON response message?
Sorry if this is a bit of a newbie question
Hi Andy, can you explain how or why you want to change the response? Is there something happening after that, where you need to see a different message?
The current JSON response looks like this:
I’d like to add some additional items to the body such as:
I’m not sure what other fields may be available, but the above would be the basics I’d be looking to add.
Eventually I will be creating workflow (via Gravity Flow), which may change the workflow stage that can then be updated via a response message, but I haven’t gotten that far yet.
status are not returned in the response when submitting a form. If the user performing the request has permissions to read entries, you can grab the entry ID from the response and then perform another call to grab the entry, and the specific information you need about the entry (like date_created and status.)
When you do get to that eventually state, make sure you take a look at the Incoming Webhook extension documentation. It can cover both being used as a step within an exiting workflow or as the trigger to receive the initial entry creation. In both cases, the field mapping / response customization option sounds like it would be a very good fit for your use case.