Skip to content

DocuSign: Creates a preview of the responsive version of a template document

DocuSign esignature.esignatureResponsiveHtmlPostTemplateDocumentResponsiveHtmlPreview: arguments, response, policy and SDK examples.

← Esignature operations · Get started

Operation docusign.esignature_responsivehtml_posttemplatedocumentresponsivehtmlpreview

Provider route: POST /restapi/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/responsive_html_preview. Alter supplies the connection’s credentials and routing.

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"]["esignatureResponsiveHtmlPostTemplateDocumentResponsiveHtmlPreview"]>[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.esignatureResponsiveHtmlPostTemplateDocumentResponsiveHtmlPreview(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from 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_document_responsive_html_preview(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.accountIdstringRequired within parent
path.documentIdstringRequired within parent
path.templateIdstringRequired within parent
bodyModelOptionalExpand 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 media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand 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

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
FieldTypePresenceDescription and constraints
$objectRoot
htmlDefinitionsarrayOptionalHolds the properties that define how to generate the responsive-formatted HTML for the document.
htmlDefinitions[]stringEach item
Creates a preview of the responsive version of a document — request body — body
FieldTypePresenceDescription and constraints
$objectRootHolds 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/).
displayAnchorPrefixstringOptionalContains text that all display anchors must start with. Using at least four characters will improve anchor processing performance.
displayAnchorsarrayOptionalAn 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[]ModelEach itemExpand Creates a preview of the responsive version of a document — request body — body display Anchors item
displayOrderstringOptionalThe position on the page where the display section appears.
displayPageNumberstringOptionalThe number of the page on which the display section appears.
documentGuidstringOptionalThe GUID of the document.
documentIdstringOptionalSpecifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute.
headerLabelstringOptionalHeader text or an HTML tag to place above the responsive HTML block.
maxScreenWidthstringOptionalIf 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.
removeEmptyTagsstringOptionalHolds a comma-separated list of HTML tags to remove if they have no text within their node (including child nodes).
showMobileOptimizedTogglestringOptionalWhen **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.
sourcestringOptionalSpecifies 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
FieldTypePresenceDescription and constraints
$objectRoot
caseSensitivebooleanOptionalWhen **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.
displaySettingsModelOptionalExpand 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.
endAnchorstringOptionalSpecifies 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.
removeEndAnchorbooleanOptionalWhen **true,** removes the end anchor string for the Smart Section from the HTML, preventing it from displaying.
removeStartAnchorbooleanOptionalWhen **true,** removes the start anchor string for the Smart Section from the HTML, preventing it from displaying.
startAnchorstringOptionalSpecifies 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
FieldTypePresenceDescription and constraints
$objectRootThis object defines how to display the HTML
between the `startAnchor` and `endAnchor`.
cellStylestringOptionalSpecifies 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.
collapsibleSettingsModelOptionalExpand 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.
displaystringOptionalSets 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.


displayLabelstringOptionalThe label to add to this display section in the signing page.
displayOrderintegerOptionalThe position on the page where the display section appears.
Format: int32
displayPageNumberintegerOptionalThe number of the page on which the display section appears.
Format: int32
hideLabelWhenOpenedbooleanOptionalWhen **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`.
inlineOuterStylestringOptionalSpecifies 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`.
labelWhenOpenedstringOptionalThe 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`.
preLabelstringOptionalEnables you to add descriptive text that appears before a collapsed section or continue button.
scrollToTopWhenOpenedbooleanOptionalWhen **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`.
tableStylestringOptionalSpecifies 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

SDK function policy ID: docusign.esignature_responsivehtml_posttemplatedocumentresponsivehtmlpreview. Catalog operation: esignature:ResponsiveHtml_PostTemplateDocumentResponsiveHtmlPreview. 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.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.