IAM SDK - Java (beta)
The Docusign Intelligent Agreement Management (IAM) SDKs assist developers in using the Intelligent Agreement Management (IAM) APIs, simplifying common tasks.
The Docusign Intelligent Agreement Management (IAM) SDKs assist developers in using the Intelligent Agreement Management (IAM) APIs, simplifying common tasks.
This page offers high-level information about the Java SDK and its usage.
APIs included in this SDK
The IAM SDKs include the following APIs:
- Workflow Builder API: Trigger and manage Agreement Builder workflows from your own app.
- Agreement Manager API: Connect AI-extracted data from agreements stored in Agreement Manager into your own app. into your own app.
- Workspaces API: Create structured, secure, and scalable agreement workflows.
- Connected Fields API: Discover extension apps that your app can use to validate input as part of the eSignature process.
Additional APIs may be added later; check this page for updates.
How to obtain the SDK
The easiest way to add the SDK to your Java project is by including the iam-sdk dependency using your preferred build tool.
Adding the Java SDK to your project using Gradle
Add the following line to your build.gradle file inside the dependencies block:
To use a different version, simply update the version number in the string.
After saving your changes, run:
./gradlew build
This will download the SDK and its dependencies into your local Gradle cache and make them available to your project.
Adding the Java SDK to your project using Maven
Add the following to your project’s pom.xml files inside the <dependencies> section:
To use a different version, adjust the <version> tag accordingly.
After updating your pom.xml, run the following command to install the dependencies:
This will fetch the SDK and its dependencies into your local Maven repository.
Getting started with the Java IAM SDK
The best way to learn how to use the Java IAM SDK is to explore the code examples provided by Docusign. You can find the Java code examples in the code-examples-java public GitHub repository. These code examples can also be part of the ZIP file downloaded when you use the Quickstart tool. This tool will also create all the necessary configuration data in your developer account so you’ll be ready to run it.
Authentication support
Every API call must be authenticated. The Java IAM SDK provides functionality to simplify the use of authentication for making IAM API calls.
Obtaining an access token
Before you begin the authentication process, you must create and configure your app. Specifically:
- Create your app and obtain your integration key (client ID).
- Generate a client secret for your app.
- Add your redirect URI to the list of allowed redirect URLs associated with your integration Key.
These settings are required to obtain an authorization code and exchange it for an access token in the steps below, which demonstrate the Confidential Authorization Code Grant flow. Other OAuth flows may require different configuration settings.
Step 1: Obtain an authorization code
To call the DocuSign IAM APIs, you must request the appropriate OAuth scopes. The SDK provides predefined constants for common scope sets. For example, AuthScope.getAllScopes() includes all scopes used across the IAM SDK. You can use these helpers or supply your own array of scopes.
If this is the first time this application is requesting an authorization code from this user, the user will be asked to provide consent. Docusign will then redirect them to your specified redirect URI with an authorization code included as a query parameter named code.
Step 2: Exchange an authorization code for an access token
After you obtain the authorization code, you need to use it to get an access token. The SDK provides helper functions to simplify this process. The example below shows the Confidential Authorization Code Grant flow. You can find examples for other supported flows in the SDK repository, including:
Using an access token
Once you have obtained an access token, you can use it to make API calls this way:
Open source repository
The source being used to build the Java IAM SDK is available publicly in the following repository on our public GitHub: https://github.com/docusign/docusign-iam-java-client. You can use it to build your own version of the SDK.
Compatibility
The Java IAM SDK requires JDK 11 or later.
Code examples
You can find code examples showcasing how to use the IAM SDK with Maestro API, Connected Fields API, and Navigator API in the code-examples-java repo.
Providing feedback about the SDK
To provide feedback on the SDK, please either submit an issue in the GitHub repository or send an email to developers@docusign.com.