Skip to content

Commit

Permalink
DEVDOCS-10166 - adding codeDepot markers
Browse files Browse the repository at this point in the history
  • Loading branch information
raileendr committed Jul 13, 2023
1 parent 9743cb8 commit b924c04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ protected Object doWork(WorkArguments args, ModelMap model,
String templateId = args.getTemplateId();

// Step 2. Construct your API headers
//ds-snippet-start:eSign17Step2
ApiClient apiClient = createApiClient(session.getBasePath(), user.getAccessToken());
//ds-snippet-end:eSign17Step2
EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);

// Step 3. is shown in the makeEnvelope method below
Expand All @@ -65,9 +67,11 @@ protected Object doWork(WorkArguments args, ModelMap model,
SIGNER_CLIENT_ID);

// Step 5. Call the eSignature REST API
//ds-snippet-start:eSign17Step5
EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envelope);
String envelopeId = envelopeSummary.getEnvelopeId();
session.setEnvelopeId(envelopeId);
//ds-snippet-end:eSign17Step5

// Step 6. Create the view request
RecipientViewRequest viewRequest = SetTemplateTabValuesService.makeRecipientViewRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static RecipientViewRequest makeRecipientViewRequest(
String clientUserId,
String dsPingUrl
) {
//ds-snippet-start:eSign17Step6
RecipientViewRequest viewRequest = new RecipientViewRequest();
// Set the url where you want the recipient to go once they are done signing
// should typically be a callback route somewhere in your app.
Expand All @@ -41,6 +42,7 @@ public static RecipientViewRequest makeRecipientViewRequest(
signerEmail,
signerName,
dsPingUrl);
//ds-snippet-end:eSign17Step6
}

public static EnvelopeDefinition makeEnvelope(
Expand All @@ -54,7 +56,8 @@ public static EnvelopeDefinition makeEnvelope(
// Create a signer recipient to sign the document, identified by name and email
// We set the clientUserId to enable embedded signing for the recipient

// Step 3. Create tabs and CustomFields
// Create tabs and CustomFields
//ds-snippet-start:eSign17Step3
List list1 = new List();
list1.setValue("green");
list1.setDocumentId("1");
Expand Down Expand Up @@ -140,9 +143,11 @@ public static EnvelopeDefinition makeEnvelope(

CustomFields cf = new CustomFields();
cf.setTextCustomFields(Collections.singletonList(customField));
//ds-snippet-end:eSign17Step3


// Next, create the top level envelope definition and populate it.
//ds-snippet-start:eSign17Step4
EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
envelopeDefinition.setEmailSubject("Please sign this document from the Java SDK");
// The Recipients object wants arrays for each recipient type
Expand All @@ -154,5 +159,6 @@ public static EnvelopeDefinition makeEnvelope(
envelopeDefinition.setStatus(EnvelopeHelpers.ENVELOPE_STATUS_SENT);

return envelopeDefinition;
//ds-snippet-end:eSign17Step4
}
}

0 comments on commit b924c04

Please sign in to comment.