Skip to content

Commit ed93399

Browse files
committed
DEVDOCS-10206 adding codeDepot markers
1 parent 8a79aba commit ed93399

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/main/java/com/docusign/controller/eSignature/examples/EG010ControllerSendBinaryDocs.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public EG010ControllerSendBinaryDocs(DSConfiguration config, Session session, Us
3131
}
3232

3333
@Override
34-
// ***DS.snippet.0.start
3534
protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws IOException {
3635
String responseString = SendBinaryDocsService.sendBinaryDocs(
3736
args,
@@ -54,5 +53,4 @@ protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse
5453
.addToModel(model, config);
5554
return DONE_EXAMPLE_PAGE;
5655
}
57-
// ***DS.snippet.0.end
5856
}

src/main/java/com/docusign/controller/eSignature/services/SendBinaryDocsService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public static String sendBinaryDocs(
4848
String accountId,
4949
String accessToken
5050
) throws IOException {
51-
// Step 1. Gather documents and their headers
5251
List<DocumentInfo> documents = List.of(
5352
new DocumentInfo(HTML_DOCUMENT_NAME, "1", DocumentType.HTML,
5453
EnvelopeHelpers.createHtmlFromTemplateFile(HTML_DOCUMENT_FILE_NAME, "args", args)
@@ -59,15 +58,15 @@ public static String sendBinaryDocs(
5958
EnvelopeHelpers.readFile(PDF_DOCUMENT_FILE_NAME))
6059
);
6160

62-
// Step 2. Make the envelope JSON request body
61+
// Make the envelope JSON request body
6362
JSONObject envelopeJSON = SendBinaryDocsService.makeEnvelopeJSON(
6463
signerName,
6564
signerEmail,
6665
ccName,
6766
ccEmail,
6867
documents);
6968

70-
// Step 3. Create the multipart body
69+
// Create the multipart body
7170
URL uri = new URL(String.format("%s/v2.1/accounts/%s/envelopes", basePath, accountId));
7271
String contentType = String.join(
7372
"",
@@ -81,6 +80,7 @@ public static String sendBinaryDocs(
8180
connection.setDoOutput(true);
8281

8382
// See https://developers.docusign.com/esign-rest-api/guides/requests-and-responses
83+
//ds-snippet-start:eSign10Step4
8484
DataOutputStream buffer = new DataOutputStream(connection.getOutputStream());
8585
SendBinaryDocsService.writeBoundaryHeader(buffer, MediaType.APPLICATION_JSON, "form-data");
8686
buffer.writeBytes(envelopeJSON.toString(DoneExample.JSON_INDENT_FACTOR));
@@ -102,6 +102,7 @@ public static String sendBinaryDocs(
102102

103103
return StreamUtils.copyToString(connection.getInputStream(), StandardCharsets.UTF_8);
104104
}
105+
//ds-snippet-end:eSign10Step4
105106

106107
private static void writeBoundaryHeader(
107108
DataOutputStream buffer,
@@ -136,6 +137,7 @@ private static void writeClosingBoundary(DataOutputStream buffer) throws IOExcep
136137
// recipient 2 - cc
137138
// The envelope will be sent first to the signer.
138139
// After it is signed, a copy is sent to the cc person.
140+
//ds-snippet-start:eSign10Step3
139141
private static JSONObject makeEnvelopeJSON(
140142
String signerName,
141143
String signerEmail,
@@ -189,6 +191,7 @@ private static JSONObject makeEnvelopeJSON(
189191

190192
return envelopeJSON;
191193
}
194+
//ds-snippet-end:eSign10Step3
192195
@Value
193196
public static class DocumentInfo {
194197
String name;

0 commit comments

Comments
 (0)