Get A/B Testing Form Preview

Purpose

To retrieve the preview details, including form metadata and HTML content, of the base form and variant forms configured for a specific Webform A/B Testing.

Endpoints

  • GET /settings/AB_testing/{AB_testing_ID}/actions/preview

Request Details

Request URL

{api-domain}/crm/{version}/settings/AB_testing/{AB_testing_ID}/actions/preview

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

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

Parameters

  • modulestring, mandatory

    The API name of the module for which the Webform A/B testing configuration was created.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/AB_testing/4794410000000772083/actions/preview?module=Leads"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-X GET

Response JSON

The AB_testing JSON array is the root element that contains the preview details of the base form and each variant form. Each object consists of these inner keys:

  • variant_form JSON array

    Represents the list of variant Webforms configured for the A/B test, along with the preview details of each variant.

    • code_formats JSON array

      Represents the supported embed formats. For Webforms, the possible values are source, embed, iframe, link, and qr_code. For portal forms, the possible values are form_url, link, and qr_code.

    • form_url string

      Represents the URL for the variant Webform when code_format is form_url.

    • module JSON object

      Represents the module associated with the variant Webform. For example, Leads.

    • name string

      Represents the name of the variant Webform.

    • active Boolean

      Represents whether the variant Webform is currently active and available for public access. Returns true if the variant is active, and false otherwise.

    • id string

      Represents the unique ID of the variant Webform.

    • source_code string

      Represents the complete embeddable source code, including HTML, CSS, and JavaScript, of the variant Webform. The value is returned as raw, unencoded markup.

  • base_form JSON object

    Represents the original Webform used as the base form in the A/B test, along with its preview details.

    • code_formats JSON array

      Represents the supported embed formats. For Webforms, the possible values are source, embed, iframe, link, and qr_code. For portal forms, the possible values are form_url, link, and qr_code.

    • form_url string

      Represents the URL for the base Webform when code_format is form_url.

    • module JSON object

      Represents the module associated with the base Webform. For example, Leads.

    • name string

      Represents the name of the base Webform.

    • active Boolean

      Represents whether the base Webform is currently active and available for public access. Returns true if the base form is active, and false otherwise.

    • id string

      Represents the unique ID of the base Webform.

    • source_code string

      Represents the complete embeddable source code, including HTML, CSS, and JavaScript, of the base Webform. The value is returned as raw, unencoded markup.

    • id string

      Represents the unique ID of the Webform A/B test configuration.

Sample Response (sanitized)

Copied{
  "AB_testing": [
    {
      "id": "4794410000000772083",
      "name": "newportalwebfor",
      "active": true,
      "module": {
        "api_name": "Contacts",
        "id": "4794410000000000129"
      },
      "base_form": {
        "id": "4794410000000765193",
        "name": "newportalwebfor",
        "active": true,
        "code_formats": [
          "form_url"
        ]
      },
      "variant_form": [
        {
          "id": "4794410000000772084",
          "name": "newportalwebfor",
          "active": true,
          "code_formats": [
            "form_url"
          ]
        },
        {
          "id": "4794410000000772085",
          "name": "newportalwebfor",
          "active": true,
          "code_formats": [
            "form_url"
          ]
        }
      ]
    }
  ]
}

Possible Errors

  • REQUIRED_PARAM_MISSING HTTP 400

    A required parameter is missing in the request.
    Resolution: Specify the mandatory module parameter and retry.

  • INVALID_DATA HTTP 400

    The resource path index provided in the request URL is invalid.
    Resolution: Verify the A/B testing ID specified in the URL and retry the request.

  • INVALID_MODULE HTTP 400

    The module name provided in the request is invalid.
    Resolution: Specify a valid CRM module API name.

  • NO_PERMISSION HTTP 403

    You do not have permission to access Webform A/B Testing preview details.
    Resolution: Ensure that your profile has the Webform A/B Testing permission enabled for the specified module (for example, Leads).