Zoho: Retrieve webform source code and embed options
Zoho webforms.getWebformPreview: arguments, response, policy and SDK examples.
← Webforms operations · Get started
Operation zoho.getwebformpreview
Provider route: GET /crm/v8/settings/webforms/{id}/actions/preview. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["webforms"]["getWebformPreview"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.webforms.getWebformPreview(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.webforms.get_webform_preview(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.id | string | Required within parent | Maximum length: 255 |
query | object | Required within parent | Additional keys: not allowed |
query.module | string | Required within parent | One of: Leads |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Retrieve webform source code and embed options — response body |
Referenced models: Retrieve webform source code and embed options — response body
Schemas
Section titled “Schemas”Retrieve webform source code and embed options — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the webform preview response, including the source code and embed code options for the webform. Additional keys: not allowed |
webforms | array | Required within parent | Contains the list of webform objects with their embed code and source code information. Maximum items: 1 |
webforms[] | Model | Each item | Expand Retrieve webform source code and embed options — response body — webforms item |
Referenced models: Retrieve webform source code and embed options — response body — webforms item
Retrieve webform source code and embed options — response body — webforms item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the embed code information for a webform, including the source code, smart URL, and embed code formats. Additional keys: not allowed |
active | boolean | Required within parent | Indicates whether the webform is active. Possible values: true - The webform is active. false - The webform is inactive. |
code_formats | array | Required within parent | Contains the list of embed code format options available for the webform. Maximum items: 5 |
code_formats[] | string | Each item | Represents a single embed code format option available for the webform, such as HTML or iframe. Maximum length: 255 |
embed_code | string | Required within parent | Represents the HTML embed code used to embed the webform into an external web page. Maximum length: 2000 |
id | string | Required within parent | Represents the unique identifier of the webform. Maximum length: 255 |
iframe_code | string | Required within parent | Represents the iframe embed code used to embed the webform in an iframe on an external web page. Maximum length: 200000 |
module | Model | Required within parent | Expand Get webforms — response body — webforms item module |
name | string | Required within parent | Represents the name of the webform. Maximum length: 255 |
smart_url | string | Required within parent | Represents the smart URL generated for the webform, which can be shared directly with visitors. Maximum length: 255 |
source_code | string | Required within parent | Represents the raw HTML source code of the webform. Maximum length: 200000 |
type | string | Required within parent | Represents the type of the form. Possible values: webform - A standard webform. portalform - A portal form for registered portal users. Maximum length: 255 |
Referenced models: Get webforms — response body — webforms item module
Get webforms — response body — webforms item module
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the CRM module associated with the webform, including its API name and identifier. Additional keys: not allowed |
api_name | string | Required within parent | Represents the display name of the user who created the webform. Maximum length: 50 |
id | string | Required within parent | Represents the unique identifier of the user who created the webform. Format: int64 Maximum length: 19 Minimum length: 1 Pattern: ^[0-9]+$ |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.getwebformpreview. Catalog operation: getWebformPreview. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.