docusign.template-responsive-html-preview.post-template-responsive-html-preview
Creates a preview of the responsive, HTML versions of all of the documents associated with a template. This method enables you to preview the PDF document conversions to responsive HTML across device types prior to sending. The request body is a documentHtmlDefinition object, which holds the responsive signing parameters that define how to generate the HTML version of the documents.
Creates a preview of the responsive versions of all of the documents associated with a template.
Overview
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-docusign |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
base_url | string | Yes | — | Docusign API root, e.g. https://<host>/api |
api_token | string | No | — | Bearer token; omit to use the workflow's token env var |
accountid | string | Yes | — | The external account number (int) or account ID GUID. |
templateid | string | Yes | — | The ID of the template. |
displayanchorprefix | string | No | — | Contains text that all display anchors must start with. Using at least four characters will improve anchor processing performance. |
displayanchors | list | No | — | 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 of the displaySettings object. |
displayorder | string | No | — | The position on the page where the display section appears. |
displaypagenumber | string | No | — | The number of the page on which the display section appears. |
documentguid | string | No | — | The GUID of the document. |
documentid | string | No | — | Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute. |
headerlabel | string | No | — | Header text or an HTML tag to place above the responsive HTML block. |
maxscreenwidth | string | No | — | 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 | No | — | Holds a comma-separated list of HTML tags to remove if they have no text within their node (including child nodes). |
showmobileoptimizedtoggle | string | No | — | 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 | No | — | 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 - How to convert a PDF file into a signable HTML document - Responsive signing [smart sections feature]: https://support.docusign.com/s/document-item?bundleId=gbo1643332197980&topicId=qlx1578456478178.html |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
base_url | string | Yes | — | Docusign API root, e.g. https://<host>/api |
api_token | string | No | — | Bearer token; omit to use the workflow's token env var |
accountid | string | Yes | — | The external account number (int) or account ID GUID. |
templateid | string | Yes | — | The ID of the template. |
displayanchorprefix | string | No | — | Contains text that all display anchors must start with. Using at least four characters will improve anchor processing performance. |
displayanchors | list | No | — | 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 of the displaySettings object. |
displayorder | string | No | — | The position on the page where the display section appears. |
displaypagenumber | string | No | — | The number of the page on which the display section appears. |
documentguid | string | No | — | The GUID of the document. |
documentid | string | No | — | Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute. |
headerlabel | string | No | — | Header text or an HTML tag to place above the responsive HTML block. |
maxscreenwidth | string | No | — | 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 | No | — | Holds a comma-separated list of HTML tags to remove if they have no text within their node (including child nodes). |
showmobileoptimizedtoggle | string | No | — | 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 | No | — | 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 - How to convert a PDF file into a signable HTML document - Responsive signing [smart sections feature]: https://support.docusign.com/s/document-item?bundleId=gbo1643332197980&topicId=qlx1578456478178.html |
status_code | integer | No | — | HTTP status code of the completed call |
response | json | No | — | Parsed JSON response body |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_at | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
failed_at_state | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | Waiting to call POST /v2.1/accounts/{accountId}/templates/{templateId}/responsive_html_preview |
completed | No | Yes | Yes | — | HTTP call succeeded |
failed | No | Yes | No | — | HTTP call failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | Perform POST /v2.1/accounts/{accountId}/templates/{templateId}/responsive_html_preview |
* (any state) | fail | failed | Record the failure reason |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "docusign.template-responsive-html-preview.post-template-responsive-html-preview",
"initial_data": {
"base_url": "value",
"accountid": "value",
"templateid": "value"
}
}