Skip to content

Commit 20b8ef8

Browse files
committed
DEVDOCS-10461 - adding codeDepot markers
1 parent c97070b commit 20b8ef8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/eSignature/examples/addDocToTemplate.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const addDocToTemplate = async (args) => {
1717
// args.accessToken
1818
// args.accountId
1919

20+
//ds-snippet-start:eSign13Step3
2021
let dsApiClient = new docusign.ApiClient();
2122
dsApiClient.setBasePath(args.basePath);
2223
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
@@ -30,17 +31,20 @@ const addDocToTemplate = async (args) => {
3031
let results = await envelopesApi.createEnvelope(args.accountId, {
3132
envelopeDefinition: envelope,
3233
});
34+
//ds-snippet-end:eSign13Step3
3335

3436
let envelopeId = results.envelopeId;
3537
console.log(`Envelope was created. EnvelopeId ${envelopeId}`);
3638

3739
// Step 3. create the recipient view, the embedded signing
40+
//ds-snippet-start:eSign13Step4
3841
let viewRequest = makeRecipientViewRequest(args.envelopeArgs);
3942
// Call the CreateRecipientView API
4043
// Exceptions will be caught by the calling function
4144
results = await envelopesApi.createRecipientView(args.accountId, envelopeId, {
4245
recipientViewRequest: viewRequest,
4346
});
47+
//ds-snippet-end:eSign13Step4
4448

4549
return { envelopeId: envelopeId, redirectUrl: results.url };
4650
};
@@ -52,6 +56,7 @@ const addDocToTemplate = async (args) => {
5256
* @returns {Envelope} An envelope definition
5357
* @private
5458
*/
59+
//ds-snippet-start:eSign13Step2
5560
function makeEnvelope(args) {
5661
// Data for this method
5762
// args.signerEmail
@@ -165,6 +170,7 @@ function makeEnvelope(args) {
165170

166171
return env;
167172
}
173+
//ds-snippet-end:eSign13Step2
168174

169175
/**
170176
* Creates document 1
@@ -210,6 +216,7 @@ function document1(args) {
210216
`;
211217
}
212218

219+
//ds-snippet-start:eSign13Step4
213220
function makeRecipientViewRequest(args) {
214221
// Data for this method
215222
// args.dsReturnUrl
@@ -247,5 +254,6 @@ function makeRecipientViewRequest(args) {
247254

248255
return viewRequest;
249256
}
257+
//ds-snippet-end:eSign13Step4
250258

251259
module.exports = { addDocToTemplate, makeEnvelope, document1, makeRecipientViewRequest };

0 commit comments

Comments
 (0)