66import com .docusign .esign .client .ApiException ;
77import com .docusign .esign .model .EnvelopeDefinition ;
88import com .docusign .esign .model .EnvelopeSummary ;
9- import com .docusign .esign .model .ReturnUrlRequest ;
9+ import com .docusign .esign .model .EnvelopeViewDocumentSettings ;
10+ import com .docusign .esign .model .EnvelopeViewRecipientSettings ;
11+ import com .docusign .esign .model .EnvelopeViewRequest ;
12+ import com .docusign .esign .model .EnvelopeViewSettings ;
13+ import com .docusign .esign .model .EnvelopeViewTaggerSettings ;
14+ import com .docusign .esign .model .EnvelopeViewTemplateSettings ;
1015import com .docusign .esign .model .ViewUrl ;
1116
1217import java .io .IOException ;
@@ -17,13 +22,46 @@ public static ViewUrl createSenderView(
1722 EnvelopesApi envelopesApi ,
1823 String accountId ,
1924 String envelopeId ,
20- String dsReturnUrl
25+ String dsReturnUrl ,
26+ String startingScreen
2127 ) throws ApiException {
2228 // Create the sender view.
2329 // Set the url where you want the recipient to go once they are done
2430 // signing should typically be a callback route somewhere in your app.
25- ReturnUrlRequest viewRequest = new ReturnUrlRequest ();
31+ EnvelopeViewRecipientSettings recipientSettings = new EnvelopeViewRecipientSettings ();
32+ recipientSettings .setShowEditRecipients ("false" );
33+ recipientSettings .setShowContactsList ("false" );
34+
35+ EnvelopeViewDocumentSettings documentSettings = new EnvelopeViewDocumentSettings ();
36+ documentSettings .setShowEditDocuments ("false" );
37+ documentSettings .setShowEditDocumentVisibility ("false" );
38+ documentSettings .setShowEditPages ("false" );
39+
40+ EnvelopeViewTaggerSettings taggerSettings = new EnvelopeViewTaggerSettings ();
41+ taggerSettings .setPaletteSections ("default" );
42+ taggerSettings .setPaletteDefault ("custom" );
43+
44+ EnvelopeViewTemplateSettings templateSettings = new EnvelopeViewTemplateSettings ();
45+ templateSettings .setShowMatchingTemplatesPrompt ("true" );
46+
47+ EnvelopeViewSettings viewSettings = new EnvelopeViewSettings ();
48+ viewSettings .setStartingScreen (startingScreen );
49+ viewSettings .setSendButtonAction ("send" );
50+ viewSettings .setShowBackButton ("false" );
51+ viewSettings .setBackButtonAction ("previousPage" );
52+ viewSettings .setShowHeaderActions ("false" );
53+ viewSettings .setShowDiscardAction ("false" );
54+ viewSettings .setLockToken ("" );
55+ viewSettings .setRecipientSettings (recipientSettings );
56+ viewSettings .setDocumentSettings (documentSettings );
57+ viewSettings .setTaggerSettings (taggerSettings );
58+ viewSettings .setTemplateSettings (templateSettings );
59+
60+ EnvelopeViewRequest viewRequest = new EnvelopeViewRequest ();
2661 viewRequest .setReturnUrl (dsReturnUrl );
62+ viewRequest .setViewAccess ("envelope" );
63+ viewRequest .setSettings (viewSettings );
64+
2765 return envelopesApi .createSenderView (accountId , envelopeId , viewRequest );
2866 }
2967 //ds-snippet-end:eSign11Step3
0 commit comments