Skip to content

Commit dde8bfb

Browse files
committed
Version 3.1.0 with full support of the Bulk Send API
## Fixed - Issue [`#98`](#98): 411 Error thrown from BulkEnvelopesAPI updateRecipients call.
1 parent 007d952 commit dde8bfb

20 files changed

+44
-43
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# DocuSign Java Client Changelog
22
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.
33

4+
## [v3.1.0] Full support of the Bulk Send API - 2019-06-26
5+
## Fixed
6+
- Issue [`#98`](https://github.com/docusign/docusign-java-client/issues/98): 411 Error thrown from BulkEnvelopesAPI updateRecipients call.
7+
48
## [v3.0.1] - eSignature API v2.1-19.1.02 - 2019-06-25
59
### BREAKING
610
- The SDK now supports version v2.1-19.1.02 of the DocuSign eSignature API.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Note: DocuSign uses **Eclipse** with **Maven** for testing purposes.
3434
<dependency>
3535
<groupId>com.docusign</groupId>
3636
<artifactId>docusign-esign-java</artifactId>
37-
<version>3.0.1</version>
37+
<version>3.1.0</version>
3838
</dependency>
3939
```
4040

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>docusign-esign-java</artifactId>
55
<packaging>jar</packaging>
66
<name>docusign-esign-java</name>
7-
<version>3.0.1</version>
7+
<version>3.1.0</version>
88
<description>The official DocuSign eSignature JAVA client is based on version 2 of the DocuSign REST API and provides libraries for JAVA application integration. It is recommended that you use this version of the library for new development.</description>
99
<url>https://www.docusign.com/developer-center</url>
1010

src/main/java/com/docusign/esign/api/BulkEnvelopesApi.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import com.docusign.esign.model.BulkEnvelopeStatus;
1111
import com.docusign.esign.model.BulkEnvelopesResponse;
12-
import com.docusign.esign.model.BulkRecipientsRequest;
1312
import com.docusign.esign.model.BulkRecipientsResponse;
1413
import com.docusign.esign.model.BulkRecipientsSummaryResponse;
1514
import com.docusign.esign.model.BulkRecipientsUpdateResponse;
@@ -404,15 +403,20 @@ public BulkEnvelopesResponse list(String accountId, BulkEnvelopesApi.ListOptions
404403
* @param accountId The external account number (int) or account ID Guid. (required)
405404
* @param envelopeId The envelopeId Guid of the envelope being accessed. (required)
406405
* @param recipientId The ID of the recipient being accessed. (required)
407-
* @param bulkRecipientsRequest (optional)
406+
* @param bulkRecipientsRequest (required)
408407
* @return BulkRecipientsSummaryResponse
409408
* @throws ApiException if fails to make API call
410409
*/
411-
public BulkRecipientsSummaryResponse updateRecipients(String accountId, String envelopeId, String recipientId, BulkRecipientsRequest bulkRecipientsRequest) throws ApiException {
410+
public BulkRecipientsSummaryResponse updateRecipients(String accountId, String envelopeId, String recipientId, byte[] bulkRecipientsRequest) throws ApiException {
412411
Object localVarPostBody = bulkRecipientsRequest;
413-
414-
// verify the required parameter 'accountId' is set
415-
if (accountId == null) {
412+
413+
// verify the required parameter 'bulkRecipientsRequest' is set
414+
if (bulkRecipientsRequest == null) {
415+
throw new ApiException(400, "Missing the required parameter 'bulkRecipientsRequest' when calling updateRecipients");
416+
}
417+
418+
// verify the required parameter 'accountId' is set
419+
if (accountId == null) {
416420
throw new ApiException(400, "Missing the required parameter 'accountId' when calling updateRecipients");
417421
}
418422

src/main/java/com/docusign/esign/client/ApiClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public ApiClient() {
127127
mapper.setDateFormat((DateFormat) dateFormat.clone());
128128

129129
// Set default User-Agent.
130-
setUserAgent("Swagger-Codegen/3.0.1/java");
130+
setUserAgent("Swagger-Codegen/3.1.0/java");
131131

132132
// Setup authentications (key: authentication name, value: authentication).
133133
authentications = new HashMap<String, Authentication>();
@@ -1244,7 +1244,9 @@ private String getXWWWFormUrlencodedParams(Map<String, Object> formParams) {
12441244
private <T> String serializeToCsv(T obj) {
12451245
if(obj == null) {
12461246
return "";
1247-
}
1247+
} else if (obj.getClass() == byte[].class) {
1248+
return new String((byte[]) obj);
1249+
}
12481250

12491251
for (Method method: obj.getClass().getMethods()) {
12501252
if ("java.util.List".equals(method.getReturnType().getName())) {

src/test/java/SdkUnitTests.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,18 +1284,9 @@ public void UpdateBulkRecipientsTest() {
12841284
EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envDef);
12851285

12861286
BulkEnvelopesApi bulkEnvelopesApi = new BulkEnvelopesApi();
1287-
BulkRecipientsRequest bulkRecipientsRequest = new BulkRecipientsRequest();
1288-
1289-
BulkRecipient bulkRecipient1 = new BulkRecipient();
1290-
bulkRecipient1.setName("John Doe");
1291-
bulkRecipient1.setEmail("[email protected]");
1292-
1293-
BulkRecipient bulkRecipient2 = new BulkRecipient();
1294-
bulkRecipient2.setName("Jane Doe");
1295-
bulkRecipient2.setEmail("[email protected]");
1296-
1297-
bulkRecipientsRequest.addBulkRecipientsItem(bulkRecipient1);
1298-
bulkRecipientsRequest.addBulkRecipientsItem(bulkRecipient2);
1287+
// Typically the Bulk Send CSV payload will come from a file, a DB query or an API call
1288+
String bulkRecipientsCSV = "name,email\n" + "John Doe,[email protected]\n" + "Jane Doe,[email protected]";
1289+
byte[] bulkRecipientsRequest = bulkRecipientsCSV.getBytes();
12991290

13001291
BulkRecipientsSummaryResponse bulkRecipientsSummaryResponse = bulkEnvelopesApi.updateRecipients(accountId, envelopeSummary.getEnvelopeId(), "1", bulkRecipientsRequest);
13011292
Assert.assertNotNull(bulkRecipientsSummaryResponse);
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)