@@ -19,26 +19,22 @@ const sendEnvelopeUsingEmbeddedSending = async (args) => {
1919 // args.accountId
2020 // args.startingView -- 'recipient' or 'tagging'
2121
22- //ds-snippet-start:eSign1Step3
2322 let dsApiClient = new docusign . ApiClient ( ) ;
2423 dsApiClient . setBasePath ( args . basePath ) ;
2524 dsApiClient . addDefaultHeader ( "Authorization" , "Bearer " + args . accessToken ) ;
2625 let envelopesApi = new docusign . EnvelopesApi ( dsApiClient ) ;
2726
28- // Make the envelope with "created" (draft) status
27+ // Step 1. Make the envelope with "created" (draft) status
2928 args . envelopeArgs . status = "created" ; // We want a draft envelope
3029
3130 let envelope = makeEnvelope ( args . envelopeArgs ) ;
3231
3332 let results = await envelopesApi . createEnvelope ( args . accountId , {
3433 envelopeDefinition : envelope ,
3534 } ) ;
36- //ds-snippet-end:eSign1Step3
37-
3835 let envelopeId = results . envelopeId ;
3936
40- // create the sender view
41- //ds-snippet-start:eSign1Step5
37+ // Step 2. create the sender view
4238 let viewRequest = makeSenderViewRequest ( args . envelopeArgs ) ;
4339 // Call the CreateSenderView API
4440 // Exceptions will be caught by the calling function
@@ -54,10 +50,8 @@ const sendEnvelopeUsingEmbeddedSending = async (args) => {
5450 }
5551
5652 return { envelopeId : envelopeId , redirectUrl : url } ;
57- //ds-snippet-end:eSign1Step5
5853} ;
5954
60- //ds-snippet-start:eSign1Step4
6155function makeSenderViewRequest ( args ) {
6256 let viewRequest = new docusign . ReturnUrlRequest ( ) ;
6357 // Data for this method
@@ -68,9 +62,7 @@ function makeSenderViewRequest(args) {
6862 viewRequest . returnUrl = args . dsReturnUrl ;
6963 return viewRequest ;
7064}
71- //ds-snippet-end:eSign1Step4
7265
73- //ds-snippet-start:eSign1Step2
7466function makeEnvelope ( args ) {
7567 // Data for this method
7668 // args.signerEmail
@@ -187,7 +179,6 @@ function makeEnvelope(args) {
187179
188180 return env ;
189181}
190- //ds-snippet-end:eSign1Step2
191182
192183/**
193184 * Creates document 1
0 commit comments