Consent field - Fill it out with JSON from Zapier to API

Documentation in GF API is very sparse on how to properly format JSON POST from other systems like Zapier. Especially since the Consent field is a REQUIRED field.

Can post other Required fields like EMAIL but not Consent (Field : input_2 below)

JSON Zapier
{
“input_1”: “{{dynamic-email-field-here-from-other-app}}”,
“input_2”: “1”,
“input_4”: “campaign-skog-2022-fb-lead-form-digital-skogshjalte” (hidden field)
}

Zapier / GF API Response
The app returned “2: Field is required.”.

Method

POST

URL

https://x.natur…se/wp-json/gf/v2/forms/x/submissions

Data Pass-Through?

false

Data

{

“input_1”: “test@fb.com”,

“input_2”: “1”,

“input_4”: “campaign-skog-2022-fb-lead-form-digital-skogshjalte”

}

Unflatten

false

Basic Auth

ck_6159ec…|cs_295fa5…

Headers

Content-Type

application/json; charset=utf-8

The consent field is a multi-input field type so you need to send each input separately instead of using input_{field_id}.

The first input (input_{field_id}_1) is the checkbox for which you would pass a value of 1 if the checkbox is checked.

The second input (input_{field_id}_2) is a hidden type input and contains the value of the field->checkboxLabel property.

The third input (input_{field_id}_3) is also a hidden type input and contains the form revision ID which can be retrieved by previewing the form and inspecting the input

Follow up question:
Looking at the API it is hard to see any explanation on how a GET request would be formulated in order to retrive the form revision ID. Can you give me a hint or direct me to where i n the API this is laid out in detail?

Reason is that I would like to programmatically check for that, rather than take a chance that nobody ever change the form.

The revision ID is currently only available via PHP on the site where the form is located:

$revision_id = GFFormsModel::get_latest_form_revisions_id( $form_id );

You can use the submit idea form on the roadmap page to request making the revision id available via the REST API at Gravity Forms Roadmap - Gravity Forms

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.