Skip to content

Commit 9c4d45f

Browse files
DEVDOCS-10341 codeDepot tags
1 parent 3533f6c commit 9c4d45f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/eSignature/examples/embeddedSending.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,26 @@ const sendEnvelopeUsingEmbeddedSending = async (args) => {
1919
// args.accountId
2020
// args.startingView -- 'recipient' or 'tagging'
2121

22+
//ds-snippet-start:eSign1Step3
2223
let dsApiClient = new docusign.ApiClient();
2324
dsApiClient.setBasePath(args.basePath);
2425
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
2526
let envelopesApi = new docusign.EnvelopesApi(dsApiClient);
2627

27-
// Step 1. Make the envelope with "created" (draft) status
28+
// Make the envelope with "created" (draft) status
2829
args.envelopeArgs.status = "created"; // We want a draft envelope
2930

3031
let envelope = makeEnvelope(args.envelopeArgs);
3132

3233
let results = await envelopesApi.createEnvelope(args.accountId, {
3334
envelopeDefinition: envelope,
3435
});
36+
//ds-snippet-end:eSign1Step3
37+
3538
let envelopeId = results.envelopeId;
3639

37-
// Step 2. create the sender view
40+
// create the sender view
41+
//ds-snippet-start:eSign1Step5
3842
let viewRequest = makeSenderViewRequest(args.envelopeArgs);
3943
// Call the CreateSenderView API
4044
// Exceptions will be caught by the calling function
@@ -50,8 +54,10 @@ const sendEnvelopeUsingEmbeddedSending = async (args) => {
5054
}
5155

5256
return { envelopeId: envelopeId, redirectUrl: url };
57+
//ds-snippet-end:eSign1Step5
5358
};
5459

60+
//ds-snippet-start:eSign1Step4
5561
function makeSenderViewRequest(args) {
5662
let viewRequest = new docusign.ReturnUrlRequest();
5763
// Data for this method
@@ -62,7 +68,9 @@ function makeSenderViewRequest(args) {
6268
viewRequest.returnUrl = args.dsReturnUrl;
6369
return viewRequest;
6470
}
71+
//ds-snippet-end:eSign1Step4
6572

73+
//ds-snippet-start:eSign1Step2
6674
function makeEnvelope(args) {
6775
// Data for this method
6876
// args.signerEmail
@@ -179,6 +187,7 @@ function makeEnvelope(args) {
179187

180188
return env;
181189
}
190+
//ds-snippet-end:eSign1Step2
182191

183192
/**
184193
* Creates document 1

0 commit comments

Comments
 (0)