Using Gravity Forms ‘gform_webapi_authentication_required_$endpoint’ PHP filter

The gform_webapi_authentication_required_ENDPOINT filter in Gravity Forms allows you to override the authentication requirements for specific Web API endpoints.

Usage

add_filter('gform_webapi_authentication_required_' . $endpoint, 'your_function_name');

Parameters

  • $authentication_required (bool): Determines whether authentication is required for the specified endpoint.

More information

See Gravity Forms Docs: gform_webapi_authentication_required_ENDPOINT

Examples

Require authentication for the GET forms/[ID] endpoint

Force users to authenticate before they can retrieve a form by ID:

add_filter('gform_webapi_authentication_required_get_forms_id', '__return_true');

Disable authentication for the GET forms endpoint

Allow users to retrieve a list of forms without authentication:

add_filter('gform_webapi_authentication_required_get_forms', '__return_false');

Custom authentication for the PUT forms/[ID] endpoint

Create a custom authentication function to grant or deny access to the form update endpoint:

function custom_auth_for_put_forms_id($authentication_required) {
    // Your custom authentication logic here
    return $authentication_required;
}
add_filter('gform_webapi_authentication_required_put_forms_id', 'custom_auth_for_put_forms_id');

Require authentication for the DELETE forms/[ID] endpoint

Force users to authenticate before they can delete a form by ID:

add_filter('gform_webapi_authentication_required_delete_forms_id', '__return_true');

Disable authentication for the GET forms/[ID]/entries endpoint

Allow users to retrieve form entries without authentication:

add_filter('gform_webapi_authentication_required_get_forms_id_entries', '__return_false');