Skip to content

Commit 0779310

Browse files
committed
adding codeDepot snippets
1 parent 172c9fc commit 0779310

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎src/main/java/com/docusign/controller/eSignature/examples/EG029ControllerApplyBrandToEnvelope.java‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,28 @@ protected void onInitModel(WorkArguments args, ModelMap model) throws Exception
4848
@Override
4949
protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response)
5050
throws ApiException, IOException {
51-
// Step 2: Construct your API headers
51+
// Construct your API headers
52+
//ds-snippet-start:eSign29Step2
5253
EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken());
54+
//ds-snippet-end:eSign29Step2
5355

54-
// Step 3: Construct your envelope JSON body
56+
// Construct your envelope JSON body
57+
//ds-snippet-start:eSign29Step3
5558
EnvelopeDefinition envelope = ApplyBrandToEnvelopeService.makeEnvelope(
5659
args.getSignerEmail(),
5760
args.getSignerName(),
5861
args.getBrandId()
5962
);
63+
//ds-snippet-end:eSign29Step3
6064

61-
// Step 5: Call the eSignature REST API
65+
// Call the eSignature REST API
66+
//ds-snippet-start:eSign29Step4
6267
EnvelopeSummary envelopeSummary = ApplyBrandToEnvelopeService.applyBrandToEnvelope(
6368
envelopesApi,
6469
session.getAccountId(),
6570
envelope
6671
);
72+
//ds-snippet-end:eSign29Step4
6773

6874
DoneExample.createDefault(getTextForCodeExampleByApiType().ExampleName)
6975
.withJsonObject(envelopeSummary)

‎src/main/java/com/docusign/controller/eSignature/services/ApplyBrandToEnvelopeService.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ public final class ApplyBrandToEnvelopeService {
1616
private static final int ANCHOR_OFFSET_Y = 10;
1717
private static final int ANCHOR_OFFSET_X = 20;
1818

19+
//ds-snippet-start:eSign29Step4
1920
public static EnvelopeSummary applyBrandToEnvelope(
2021
EnvelopesApi envelopesApi,
2122
String accountId,
2223
EnvelopeDefinition envelope
2324
) throws ApiException {
2425
return envelopesApi.createEnvelope(accountId, envelope);
2526
}
27+
//ds-snippet-end:eSign29Step4
2628

2729
public static BrandsResponse getBrands(
2830
AccountsApi accountsApi,
@@ -34,6 +36,7 @@ public static BrandsResponse getBrands(
3436
// Creates an envelope. The envelope has one recipient who should sign an
3537
// attached document. Attached document is read from a local directory.
3638
// Also the envelope contains a brand Id which is created on EG028 example.
39+
//ds-snippet-start:eSign29Step3
3740
public static EnvelopeDefinition makeEnvelope(
3841
String signerEmail,
3942
String signerName,
@@ -63,4 +66,5 @@ public static EnvelopeDefinition makeEnvelope(
6366
.brandId(brandId)
6467
.status(EnvelopeHelpers.ENVELOPE_STATUS_SENT);
6568
}
69+
//ds-snippet-end:eSign29Step3
6670
}

0 commit comments

Comments
 (0)