FINS DocuSign System API - Implementation Template
home
This API implementation template is a component of MuleSoft Accelerators, which accelerate the implementation of essential integration use cases.
The solution includes pre-built APIs, connectors, and integration templates that help unlock business-critical data from external systems and guide you in adopting best practices synthesized from thousands of customer implementations. Use these assets as is or extend them to meet your company’s unique needs.
Overview
This integration template implements the DocuSign System API specification. It can be used to retrieve, create, and send documents via DocuSign.
Getting started
The Getting Started with MuleSoft Accelerators guide provides general information on getting started with the accelerator components. This includes instructions on setting up your local workstation for configuring and deploying the applications. |
Once your workstation has been set up and the application template imported into Anypoint Studio, proceed with the Prerequisites section.
Prerequisites
This implementation template has the following dependencies:
- An Integration App has been created in DocuSign
- The Mule application has been configured accordingly
- The Mule Application has been authorized to connect to DocuSign
Please review the use cases described on the MuleSoft Accelerator for Financial Services solution pages for more information about dependencies on other APIs and services.
Creating an Integration App in DocuSign
This application requires an app and integration key to be created in your DocuSign account, which can be done as follows:
- Login to the target DocuSign account
- Go to the
Settings
page and traverse toApps and Keys
- Create a new integration app (e.g.,
Accelerator-FINS
); record the integration key and application name values for later - Select the
Authorization Code Grant
type - Create a secret key and record the value for later (note: it cannot be recovered once saved)
- Add a redirect URI corresponding to the
callback
endpoint in the deployed application. It must be in the formathttps://<URL of CloudHub application>/callback
(e.g.,https://abc-docusign-sys-api-v1-dev.us-east-2.cloudhub.io/callback
). Record this value for later. - If desired, add another redirect URI for local testing from Anypoint Studio (e.g,.
https://localhost:8082/callback
). - Save the app settings
Configuring the DocuSign System API
Configure the application deployment properties using the values recorded while creating the Integration App, above.
- Set the
docusign.auth.app-name
property in theconfig-{env}.yaml
file to match the DocuSign application name - Assign the generated Integration Key to the
docusign.auth.consumer-key
property - Assign the generated secret key to the
docusign.auth.consumer-secret
property (use a secured or hidden deployment property for security reasons) - Assign the callback URI for the deployed application to the
docusign.auth.redirect-uri
property in theconfig-{env}.yaml
file - To run the application from Studio, assign the local URI to the
docusign.auth.redirect-uri
property inconfig-local.yaml
file
Authorizing the Mule Application to connect to DocuSign
Enter the following auth URL in your Web browser to Authorize the Mule application to connect to DocuSign:
<URL of the deployed application>/auth?resourceOwnerId=<Integration App Name>
For example, the URL for authorizing an application deployed to CloudHub would be something like this:
https://docusign-sys-api-dev.ca-c1.cloudhub.io/auth?resourceOwnerId=Accelerator-FINS
If the application is running locally, on the other hand, the URL should be something like this:https://localhost:8082/auth?resourceOwnerId=Accelerator-FINS
Calling the auth URL will prompt you to enter the DocuSign instance credentials (username and password). When prompted to authorize the application, choose to accept. Once successfully logged in, the message Successfully retrieved access token will be displayed in the browser. You are now ready to deploy and run the DocuSign System API application.
Troubleshooting
If you are unable to connect to the DocuSign instance from the DocuSign System API, something in either the application or DocuSign configuration is missing or incorrect. The following table describes some common issues that may be encountered, along with some suggested resolution steps.
Issue | Possible Cause | Resolution |
---|---|---|
OAuth authorization dance not yet performed for resourceOwnerId Accelerator-FINS | One of the assigned config values for docusign.auth.consumer-key , docusign.auth.consumer-secret , or docusign.auth.app-name may be incorrect. It is also possible that either the Authorization step above has not been performed, or the application has been redeployed/renamed. | Verify that all the config values are assigned correctly as described above. Repeat the steps to Authorize the Mule Application to connect to DocuSign. |
Deployment
Each Accelerator implementation template in Exchange includes Bash and Windows scripts for building and deploying the APIs to CloudHub. These scripts depend on repositories, global settings, deployment profiles, and associated properties configured in the Maven settings.xml
file.
For additional details, please refer to the Application Deployment section of the Getting Started Guide.
Preparation
Ensure the Maven profile CloudHub-FINS-DEV
has been properly configured in your settings.xml
file. In particular, make sure the common properties for your environment have been provided (e.g., Anypoint Platform client ID and secret).
Required property overrides
At a minimum, the following properties must be customized for this application to reflect the target deployment environment.
Property Name | Description |
---|---|
api.autodiscoveryID | Required if using API Manager to secure this API |
docusign.account | Docusign Account Id. This can be obtained by clicking on the profile image on the upper-right corner of the DocuSign Instance, beneath your user name in the drop-down menu. |
docusign.auth.consumer-key | Integration Key of the connected app |
docusign.auth.consumer-secret | Secret Key of the connected app |
Testing
Use Advanced Rest Client or Postman to send a request over HTTPS. The template includes a Postman collection in the src/test/resources
folder. Update the collection variable(s) after successful import.
Additional resources
- The Data mappings tab describes how the request and response data structures are mapped between the API interfaces.
- Refer to the Accelerators documentation home for more information about the MuleSoft Accelerators.