Using Gravity Forms ‘gform_zoho_api_url’ PHP filter

The gform_zoho_api_url Gravity Forms filter allows you to change the API URL for Zoho CRM integrations.

Usage

add_filter('gform_zoho_api_url', 'your_function_name', 10, 1);

Parameters

  • $api_url (string): The Zoho CRM API URL.

More information

See Gravity Forms Docs: gform_zoho_api_url

This filter was added in Zoho CRM version 1.2.5 and is located in GF_ZohoCRM_API::__construct() in gravityformszohocrm/class-gf-zohocrm-api.php.

Examples

Change Zoho API URL to European domain

Switch the Zoho CRM API URL to the European domain.

add_filter('gform_zoho_api_url', 'change_zoho_api_url', 10, 1);

function change_zoho_api_url($api_url) {
    return "https://crm.zoho.eu/crm/private/";
}

Use a custom API URL for Zoho CRM

Replace the Zoho CRM API URL with your own custom URL.

add_filter('gform_zoho_api_url', 'use_custom_zoho_api_url', 10, 1);

function use_custom_zoho_api_url($api_url) {
    return "https://custom.zoho.api/crm/private/";
}

Conditionally change the Zoho API URL

Change the Zoho API URL based on a specific condition.

add_filter('gform_zoho_api_url', 'conditionally_change_zoho_api_url', 10, 1);

function conditionally_change_zoho_api_url($api_url) {
    if (some_condition()) {
        return "https://crm.zoho.eu/crm/private/";
    }

    return $api_url;
}

Use different Zoho API URLs for different forms

Switch the Zoho API URL depending on the form ID.

add_filter('gform_zoho_api_url', 'use_different_zoho_api_urls', 10, 2);

function use_different_zoho_api_urls($api_url, $form_id) {
    if ($form_id == 1) {
        return "https://crm.zoho.eu/crm/private/";
    } elseif ($form_id == 2) {
        return "https://custom.zoho.api/crm/private/";
    }

    return $api_url;
}

Log Zoho API URL changes

Log any changes made to the Zoho API URL.

add_filter('gform_zoho_api_url', 'log_zoho_api_url_changes', 10, 1);

function log_zoho_api_url_changes($api_url) {
    error_log("Zoho API URL changed to: " . $api_url);
    return $api_url;
}