DocuSign: Creates a preview of the responsive versions of all of the documents associated with a template
DocuSign esignature.esignatureResponsiveHtmlPostTemplateResponsiveHtmlPreview: arguments, response, policy and SDK examples.
← Esignature operations · Get started
Operation docusign.esignature_responsivehtml_posttemplateresponsivehtmlpreview
Provider route: POST /restapi/v2.1/accounts/{accountId}/templates/{templateId}/responsive_html_preview. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/docusign with npm, or alter-sdk-docusign with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { DocuSignIntegration } from "@alter-ai/docusign";
async function execute(input: Parameters<DocuSignIntegration["esignature"]["esignatureResponsiveHtmlPostTemplateResponsiveHtmlPreview"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new DocuSignIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.esignature.esignatureResponsiveHtmlPostTemplateResponsiveHtmlPreview(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_docusign import DocuSignIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = DocuSignIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.esignature.esignature_responsive_html_post_template_responsive_html_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.accountId | string | Required within parent | |
path.templateId | string | Required within parent | |
body | Model | Optional | Expand Creates a preview of the responsive version of a document — request body — body |
Referenced models: Creates a preview of the responsive version of a document — request body — body
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 Creates a preview of the responsive version of a document — response body |
Referenced models: Creates a preview of the responsive version of a document — response body
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
Creates a preview of the responsive version of a document — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
htmlDefinitions | array | Optional | Holds the properties that define how to generate the responsive-formatted HTML for the document. |
htmlDefinitions[] | string | Each item |
Creates a preview of the responsive version of a document — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Holds the properties that define how to generate the responsive-formatted HTML for the document. See [Responsive signing](/docs/esign-rest-api/esign101/concepts/responsive/) in the [eSignature concepts guide](/docs/esign-rest-api/esign101/concepts/). |
displayAnchorPrefix | string | Optional | Contains text that all display anchors must start with. Using at least four characters will improve anchor processing performance. |
displayAnchors | array | Optional | An object that defines how to handle a section of the HTML in signing. This property enables an incoming request to make a section of the HTML collapsible and expandable or hidden from view. A start anchor, end anchor, or both are required. If the anchors are not found, the display anchor will be ignored. For a list of the available types, see the [`display` property](/docs/esign-rest-api/reference/envelopes/envelopes/create/#schema__envelopedefinition_documents_htmldefinition_displayanchors_displaysettings_display) of the [`displaySettings` object.](/docs/esign-rest-api/reference/envelopes/envelopes/create/#schema__envelopedefinition_documents_htmldefinition_displayanchors_displaysettings) |
displayAnchors[] | Model | Each item | Expand Creates a preview of the responsive version of a document — request body — body display Anchors item |
displayOrder | string | Optional | The position on the page where the display section appears. |
displayPageNumber | string | Optional | The number of the page on which the display section appears. |
documentGuid | string | Optional | The GUID of the document. |
documentId | string | Optional | Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute. |
headerLabel | string | Optional | Header text or an HTML tag to place above the responsive HTML block. |
maxScreenWidth | string | Optional | If set, the responsive HTML version of the signing document will only display on screens with the specified pixel width or less. If the screen is larger than the value that you specify, the default PDF version of the content displays instead. This setting can also be configured at the account level. |
removeEmptyTags | string | Optional | Holds a comma-separated list of HTML tags to remove if they have no text within their node (including child nodes). |
showMobileOptimizedToggle | string | Optional | When **true** (the default), the **Mobile-Friendly** toggle displays at the top of the screen on the user's mobile device. When **false,** the toggle will not be displayed. the **Mobile-Friendly** toggle lets the user switch between the mobile-friendly and the PDF versions of a document. For example, the recipient can use this toggle to review the document using the PDF view before they finish signing. |
source | string | Optional | Specifies the type of responsive signing that will be used with the document. If the value of this property is valid HTML, and the [smart sections feature][] is enabled, the HTML code is used to display the signing page: ``` source: "<html> ... <body><p>hello world</p></body></html>" ``` If the value of this property is the string `document`, the HTML signing page is generated from the provided document. ``` source: "document" ``` **Related topics** - [How to create a signable HTML document](/docs/esign-rest-api/how-to/creating-signable-html/) - [How to convert a PDF file into a signable HTML document](/docs/esign-rest-api/how-to/converting-pdf/) - [Responsive signing](/docs/esign-rest-api/esign101/concepts/responsive/) [smart sections feature]: https://support.docusign.com/s/document-item?bundleId=gbo1643332197980&topicId=qlx1578456478178.html |
Referenced models: Creates a preview of the responsive version of a document — request body — body display Anchors item
Creates a preview of the responsive version of a document — request body — body display Anchors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
caseSensitive | boolean | Optional | When **true,** the start or end anchor strings must match the strings specified by the start and end anchor settings in case as well as in content. |
displaySettings | Model | Optional | Expand Creates a preview of the responsive version of a document — request body — body display Anchors item display Settings This object defines how the HTML section inside the `startAnchor` and `endAnchor` displays. |
endAnchor | string | Optional | Specifies the end of the area in the HTML where the display settings will be applied. If you do not specify an end anchor, the end of the document will be used by default. **Note:** A start anchor, an end anchor, or both are required. |
removeEndAnchor | boolean | Optional | When **true,** removes the end anchor string for the Smart Section from the HTML, preventing it from displaying. |
removeStartAnchor | boolean | Optional | When **true,** removes the start anchor string for the Smart Section from the HTML, preventing it from displaying. |
startAnchor | string | Optional | Specifies the beginning of the area in the HTML where the display settings will be applied. If you do not specify a start anchor, the beginning of the document will be used by default. **Note:** A start anchor, an end anchor, or both are required. |
Referenced models: Creates a preview of the responsive version of a document — request body — body display Anchors item display Settings
Creates a preview of the responsive version of a document — request body — body display Anchors item display Settings
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This object defines how to display the HTML between the `startAnchor` and `endAnchor`. |
cellStyle | string | Optional | Specifies the valid CSS-formatted styles to use on responsive table cells. Only valid in display sections of `responsive_table` or `responsive_table_single_column` types. |
collapsibleSettings | Model | Optional | Expand Creates a preview of the responsive version of a document — request body — body display Anchors item display Settings collapsible Settings This object defines the appearance and function of a collapsible section or item. |
display | string | Optional | Sets the display and behavior properties. Possible values are: - `inline`: Leaves the HTML where it is in the document. This property lets you add a label or present on a separate page. - `collapsible`: The HTML in this section may be expanded or collapsed. Initially this section is expanded. - `collapsed`: The HTML in this section may be expanded or collapsed. Initially this section is collapsed. - `continue_button`: Creates a stop point in the document to draw the reader's attention before proceeding to the next section. - `responsive_table`: Turns this section into a responsive table. Note that this is only used on HTML tables that fall within the anchor start and end positions. - `responsive_table_single_column`: Turns this section into a responsive single-column table. Note this is only used on HTML tables that fall within the anchor start and end positions. The table will be converted to one single column where each current column will become a row, then stacked. - `print_only`: Do not show this portion of the HTML in the responsive signing view. |
displayLabel | string | Optional | The label to add to this display section in the signing page. |
displayOrder | integer | Optional | The position on the page where the display section appears. Format: int32 |
displayPageNumber | integer | Optional | The number of the page on which the display section appears. Format: int32 |
hideLabelWhenOpened | boolean | Optional | When **true,** the `displayLabel` is hidden when the display section is expanded and the display section is no longer collapsible. This property is valid only when the value of the `display` property is `collapsed`. |
inlineOuterStyle | string | Optional | Specifies the valid CSS-formatted styles to use on inline display sections. This property is valid only when the value of the `display` property is `inline`. |
labelWhenOpened | string | Optional | The label for the display section when it is expanded from a collapsed state. This label displays only on the first opening and is only valid with the value of the `display` property is `collapsed`. |
preLabel | string | Optional | Enables you to add descriptive text that appears before a collapsed section or continue button. |
scrollToTopWhenOpened | boolean | Optional | When **true** and the section is expanded, the position of the section-close control scrolls to the top of the screen. This property is only valid when the value of the `display` property is `collapsed`. |
tableStyle | string | Optional | Specifies the valid CSS-formatted styles to use on responsive tables. This property is valid only when the value of the `display` property is `responsive_table` or `responsive_table_single_column`. |
Referenced models: Creates a preview of the responsive version of a document — request body — body display Anchors item display Settings collapsible Settings
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: docusign.esignature_responsivehtml_posttemplateresponsivehtmlpreview. Catalog operation: esignature:ResponsiveHtml_PostTemplateResponsiveHtmlPreview. 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.