- "Text": "View source file <a target='_blank' rel='noopener noreferrer' href='https://github.com/docusign/sample-app-healthcare-python/blob/master/backend/docusign/templates/make_application_for_participation_signer.py'> make_application_for_participation_signer.py</a> on GitHub.<br><br><h3>This sample features:</h3><ul><li>Focused view</li><li>Templates</li><li>Signer attachment tab</li><li>Connected fields</li></ul><h3>Code flow:</h3><h5>Step 1</h5><p>When the button is selected, we call the <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/esign-rest-api/reference/Templates/Templates/list'>Templates:list</a> method on the account to check if a template exists. If it does, we find the templateId; if not, we call the <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/esign-rest-api/reference/Templates/Templates/create'>Templates:create</a> method to create a new template with the required fields and documents and a single placeholder recipient.</code></p><h5>Step 2</h5><p>We proceed to create an envelope from the template by using the <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/Envelopes/create'>Envelopes:create</a> method, using the provided email address and name for the recipient. <p>Before the envelope is created, we call the <a target=\"_blank\" href=\"https://developers.docusign.com/docs/connected-fields-api/reference/connectedfields/tabinfo/getconnectedfieldstabgroups/\">TabInfo: GetConnectedFieldsTabGroups</a> endpoint to get a list of extension apps in our account. The tab data returned by that response is then used to construct connected fields in the envelope.</p></p><h5>Step 3</h5><p>We make an API call to the <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient'>EnvelopeViews:createRecipient</a> method to generate a signing URL for the recipient. To use the returned signing URL with focused view, the request body for this API call must include the <code>clientUserId</code>, <code>returnUrl</code>, <code>frameAncestors</code>, and <code>messageOrigins</code> fields.</p><h5>Step 4</h5> We next embed the envelope on the page. To do this, we place a <code>div</code> container on the HTML page, and then use the Docusign JS library to mount the envelope to the page. We will need to provide the signing URL from the previous step and the id of the div where the document will be rendered. We can also customize the <code>finishText</code>, <code>position</code>, and <code>signingNavigation</code> button for focused view signing.</p><p>Learn how to set up your HTML page and create a focused view script using the Docusign JS library on the <a href='https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-focused-view/' target='_blank'>Docusign Developer Center</a>.</p>"
0 commit comments