Webform Differences

Purpose

To compare two Webforms and retrieve the differences between them. The base Webform serves as the reference point, and the variant Webform is the one you want to compare against the base. The response highlights fields that were added, removed, or modified in the variant compared to the base, along with any changes to form attributes and button attributes. This allows you to identify exactly what has changed between two versions of a Webform configured in your Zoho CRM organization.

  • GET /settings/webforms/diff

Request Details

Request URL

{api-domain}/crm/v8/settings/webforms/diff

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.settings.webforms.READ 
(or)
ZohoCRM.settings.webforms.ALL 

Parameters

  • base_formstring, mandatory

    Specify the ID of the base Webform to compare against.

  • variant_formstring, mandatory

    Specify the ID of the variant Webform to compare with the base Webform.

Note

  • The base and variant forms must belong to the same module.
  • The base and variant forms must not be the same Webform.
  • If there are no differences between the base and variant forms, the response returns an empty array.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/webforms/diff?base_form=5843104000008594006&variant_form=5843104000008493001" 
-X GET 
-H "Authorization: Zoho-oauthtoken 1000.xxxxxxxxxxxxxxxxxxxxx"

Response JSON

The diff JSON array consists of the differences between the base and variant Webforms configured in your Zoho CRM organization. This includes the following keys:

  • modified_fieldsJSON array

    Represents the list of fields that exist in both Webforms but have different configurations in the variant. Each object contains the following keys.

    • helpJSON object

      Represents the help text configuration for the field. Contains the following keys.

      • textstring

        Represents the help text content.

      • urlstring

        Represents the URL associated with the help text.

      • statusstring

        Indicates the status of the help text change.

    • api_namestring

      Represents the API name of the field.

    • original_namestring

      Represents the display name of the field.

    • field_labelstring

      Represents the label identifier of the field in the Webform.

    • idstring

      Represents the unique ID of the field.

    • requiredBoolean

      Indicates whether the field is mandatory in the Webform.

  • added_fieldsJSON array

    Represents the list of fields that are present in the variant Webform but not in the base Webform. Each object contains the following keys.

    • helpJSON object

      Represents the help text configuration for the field. The value is null if no help text is configured.

    • hiddenBoolean

      Indicates whether the field is hidden in the Webform.

    • api_namestring

      Represents the API name of the field.

    • original_namestring

      Represents the display name of the field.

    • field_labelstring

      Represents the label identifier of the field in the Webform.

    • default_valuestring

      Represents the default value assigned to the field, if any.

    • idstring

      Represents the unique ID of the field.

    • requiredBoolean

      Indicates whether the field is mandatory in the Webform.

  • removed_fieldsJSON array

    Represents the list of fields that are present in the base Webform but not in the variant Webform. Each object contains the following keys.

    • api_namestring

      Represents the API name of the removed field.

    • field_labelstring

      Represents the label of the removed field.

    • idstring

      Represents the unique ID of the removed field.

  • button_attributesJSON object

    Represents the differences in button configurations between the two Webforms. The value is null if there are no differences in button attributes.

  • form_attributesJSON object

    Represents the differences in form-level settings between the two Webforms. Contains the following keys.

    • colorstring

      Represents the form color setting.

Sample Response when Webforms are different

Copied{
    "diff": [
        {
            "modified_fields": [
                {
                    "display_label": "0:flc:Company",
                    "field": {
                        "api_name": "Company",
                        "field_label": "0:flc:Company",
                        "id": "5843104000000002591"
                    },
                    "type": "general",
                    "required": false
                }
            ],
            "added_fields": [
                {
                    "display_label": "Fax",
                    "help": null,
                    "field": {
                        "api_name": "Fax",
                        "field_label": "Fax",
                        "id": "5843104000000002603"
                    },
                    "hidden": false,
                    "type": "general",
                    "required": false
                },
                {
                    "display_label": "Salutation",
                    "help": null,
                    "field": {
                        "api_name": "Salutation",
                        "field_label": "Salutation",
                        "id": "5843104000000022011"
                    },
                    "hidden": false,
                    "type": "general",
                    "required": false
                }
            ],
            "button_attributes": null,
            "form_attributes": null,
            "removed_fields": [
                {
                    "display_label": "Mobile",
                    "field": {
                        "api_name": "Mobile",
                        "field_label": "Mobile",
                        "id": "5843104000000002605"
                    },
                    "type": "general"
                }
            ]
        }
    ]
}

Possible Errors

  • INVALID_DATAHTTP 400

    The given Webform ID is invalid.
    Resolution: Specify a valid Webform ID.

  • INVALID_FORM_IDHTTP 400

    Both form IDs are the same or do not belong to the same module.
    Resolution: Ensure the base and variant Webform IDs are different and valid.

  • REQUIRED_PARAM_MISSINGHTTP 400

    One of the required parameters is missing.
    Resolution: Specify both base_form and variant_form.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized access.
    Resolution: Generate a new access token with the required scope.

  • NO_PERMISSIONHTTP 403

    Permission denied to access Webform settings.
    Resolution: Ensure the user has the required permissions and scope.

  • INTERNAL_ERRORHTTP 500

    Internal server error.
    Resolution: Contact Zoho CRM support.

Sample response when the Webforms are identical

Copied   {
    "diff": [
    {}
    ]
   }