Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Commit 1be8e44

Browse files
author
Chris Paul
authored
Merge pull request #34 from HelloFax/issue-13
Refactor HTTP client and update automated tests.
2 parents e154f96 + a57390e commit 1be8e44

File tree

171 files changed

+6004
-6461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+6004
-6461
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
language: java

README.md

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# HelloSign Java SDK
1+
# HelloSign Java SDK
2+
[![Build Status](https://travis-ci.org/HelloFax/hellosign-java-sdk.svg?branch=master)](https://travis-ci.org/HelloFax/hellosign-java-sdk) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.hellosign/hellosign-java-sdk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.hellosign/hellosign-java-sdk/) [![Javadoc](https://javadoc-emblem.rhcloud.com/doc/com.hellosign/hellosign-java-sdk/badge.svg)](http://www.javadoc.io/doc/com.hellosign/hellosign-java-sdk/)
23

3-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.hellosign/hellosign-java-sdk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.hellosign/hellosign-java-sdk/)
4-
[![Javadoc](https://javadoc-emblem.rhcloud.com/doc/com.hellosign/hellosign-java-sdk/badge.svg)](http://www.javadoc.io/doc/com.hellosign/hellosign-java-sdk/)
5-
6-
Use the `hellosign-java-sdk` to get your Java app connected to HelloSign's API in minutes.
4+
Get your Java app connected to HelloSign's API in jiffy.
75

86
## Installing
97

10-
The SDK is built and deployed to the [Central Maven repository](https://repo1.maven.org/maven2/com/hellosign/hellosign-java-sdk/). Add it to your Maven project by including the following `<dependency>` in your `pom.xml`:
8+
SDK releases are published to Maven's [Central repository](https://repo1.maven.org/maven2/com/hellosign/hellosign-java-sdk/):
119

1210
```xml
1311
<dependency>
@@ -18,24 +16,22 @@ The SDK is built and deployed to the [Central Maven repository](https://repo1.ma
1816
</dependency>
1917
```
2018

21-
> NOTE: It is compiled with and targeted for Java 7 and depends on the [SL4J 1.7.5](http://www.slf4j.org/) and JSON v20090211 libraries. If your project already includes these, use the JAR without dependencies by removing the `<classifier>` element in the example above.
22-
2319
Alternatively, you can build the JAR yourself:
2420

25-
mvn clean package -DskipTests
21+
mvn clean package
2622

27-
Locate the JAR file in the `target` directory and place it on your project classpath.
23+
Place `target/hellosign-java-sdk-<VERSION>.jar` on your project classpath.
2824

2925
## Usage
3026

31-
All HelloSign API requests are made using the `HelloSignClient`. This class must be initialized with your [API key](https://www.hellosign.com/home/myAccount/current_tab/integrations#api).
27+
First initialize an instance of the `HelloSignClient` with your [API key](https://www.hellosign.com/home/myAccount/current_tab/integrations#api):
28+
3229
```java
3330
HelloSignClient client = new HelloSignClient(apiKey);
3431
```
35-
The following examples assume the client has been initialized this way.
3632

3733
### Create a Signature Request
38-
Construct a `SignatureRequest` object and populate it with request details. When you provide this object to the `HelloSignClient.sendSignatureRequest()` method, an HTTP request will be made and the method will return a `SignatureRequest` object. Use this object to read details about the new signature request.
34+
3935
```java
4036
SignatureRequest request = new SignatureRequest();
4137
request.setSubject("NDA");
@@ -45,11 +41,9 @@ request.addFile(new File("nda.pdf"));
4541

4642
SignatureRequest response = client.sendSignatureRequest(request);
4743
System.out.println(response.toString());
48-
// Prints the JSON response to the console
4944
```
5045

5146
### Retrieve Templates
52-
The HelloSign API provides paged lists of templates and signature requests (`client.getSignatureRequests()`). These lists are represented as objects that can be iterated upon:
5347

5448
```java
5549
TemplateList templateList = client.getTemplates();
@@ -58,7 +52,7 @@ for (Template template : templateList) {
5852
}
5953
```
6054

61-
The paged list can also be filtered by a particular parameter and value:
55+
Or filter the paged list:
6256

6357
```java
6458
TemplateList templateList = client.getTemplates();
@@ -69,17 +63,16 @@ for (Template template : filteredList) {
6963
```
7064

7165
### Create a Signature Request from a Template
72-
Using a `template` object retrieved from the API, create a signature request with it:
66+
7367
```java
7468
TemplateSignatureRequest request = new TemplateSignatureRequest();
75-
request.setTemplateId(template.getId());
69+
request.setTemplateId(templateId);
7670
request.setSigner("Client", "george@example.com", "George");
7771
request.setCC("Accounting", "accounting@hellosign.com");
7872
request.addCustomFieldValue("Cost", "$20,000");
7973

8074
SignatureRequest response = client.sendTemplateSignatureRequest(request);
8175
System.out.println(response.toString());
82-
// Prints the JSON response to the console
8376
```
8477

8578
### Checking the Status of a Signature Request
@@ -97,11 +90,8 @@ if (response.isComplete()) {
9790

9891
## Reference
9992

100-
The complete JavaDoc is kindly hosted at [javadoc.io](http://www.javadoc.io/):
101-
http://www.javadoc.io/doc/com.hellosign/hellosign-java-sdk
102-
103-
<!-- We've also built a sample J2EE application that demonstrates how to use the SDK for creating requests, working with embedded flows, and handling callback events:
104-
https://www.github.com/cmpaul/jellosign -->
93+
* [API Reference](http://www.javadoc.io/doc/com.hellosign/hellosign-java-sdk)
94+
* [Sample JSP web application](https://www.github.com/cmpaul/jellosign)
10595

10696
## License
10797

0 commit comments

Comments
 (0)