You can sign up for a free developer sandbox.
Java 1.7 or later.
Add this dependency to your project's POM:
<dependency>
<groupId>com.docusign</groupId>
<artifactId>docusign-esign-java</artifactId>
<version>2.0.0</version>
</dependency>
Add this dependency to your project's build file:
compile "com.docusign:docusign-esign-java:2.0.0"
If you encounter build errors due to duplicate definitions, include the following in your build.gradle module:
android {
packagingOptions {
pickFirst 'META-INF/services/javax.ws.rs.ext.MessageBodyReader’
pickFirst 'META-INF/services/javax.ws.rs.ext.MessageBodyWriter’
pickFirst 'META-INF/services/com.sun.jersey.spi.inject.InjectableProvider’
pickFirst 'META-INF/jersey-module-version' pickFirst 'META-INF/NOTICE’
pickFirst 'META-INF/LICENSE’
pickFirst 'META-INF/services/com.fasterxml.jackson.databind.Module’
pickFirst 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec’
pickFirst 'META-INF/services/com.fasterxml.jackson.core.JsonFactory’
}
}
This client is available through the following Java package managers:
- Nexus Repository Manager (oss.sonatype.org). You can search for com.docusign or docusign-esign-java. The current version is 2.0.0.
- JFrog Bintray (bintray.com). You can search for com.docusign or docusign-esign-java. The current version is 2.0.0.
Or you can manually download and add the following JARs to your project:
- The docusign-esign-java-2.0.0 JAR.
- The Dependency JARs in /lib folder.
To initialize the client and make the Login API Call:
import com.docusign.esign.api.*;
import com.docusign.esign.client.*;
import com.docusign.esign.model.*;
public class DocuSignExample {
public static void main(String[] args) {
String username = "[EMAIL]";
String password = "[PASSWORD]";
String integratorKey = "[INTEGRATOR_KEY]";
// initialize client for desired environment and add X-DocuSign-Authentication header
ApiClient apiClient = new ApiClient();
apiClient.setBasePath("https://demo.docusign.net/restapi");
// configure custom authentication header
String authHeader = "{\"Username\":\"" + username + "\",\"Password\":\"" + password + "\",\"IntegratorKey\":\"" + integratorKey + "\"}";
apiClient.addDefaultHeader("X-DocuSign-Authentication", authHeader);
Configuration.setDefaultApiClient(apiClient);
try
{
AuthenticationApi authApi = new AuthenticationApi();
LoginInformation loginInfo = authApi.login();
String accountId = loginInfo.getLoginAccounts().get(0).getAccountId();
}
catch (com.docusign.esign.client.ApiException ex)
{
System.out.println("Exception: " + ex);
}
}
}
See CoreRecipes.java for more examples.
You must have Maven installed. To run the tests:
mvn test
Feel free to log issues against this client through GitHub. We also have an active developer community on Stack Overflow, search the DocuSignAPI tag.
The DocuSign Java Client is licensed under the following License.
This version of the client library does not implement all of the DocuSign REST API methods. The current client omits methods in the Accounts, Billing, Cloud Storage, Connect, Groups (Branding), and Templates (Bulk Recipients) categories. The client's methods support the core set of use cases that most integrations will encounter. For a complete list of omitted endpoints, see Omitted Endpoints.