FINS DocuSign System API - Implementation Template

(0 reviews)
Component of the MuleSoft FINS Accelerator for FINS

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

bulb.png 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:

  1. Login to the target DocuSign account
  2. Go to the Settings page and traverse to Apps and Keys
  3. Create a new integration app (e.g., Accelerator-FINS); record the integration key and application name values for later
  4. Select the Authorization Code Grant type
  5. Create a secret key and record the value for later (note: it cannot be recovered once saved)
  6. Add a redirect URI corresponding to the callback endpoint in the deployed application. It must be in the format https://<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.
  7. If desired, add another redirect URI for local testing from Anypoint Studio (e.g,. https://localhost:8082/callback).
  8. Save the app settings

Configuring the DocuSign System API

Configure the application deployment properties using the values recorded while creating the Integration App, above.

  1. Set the docusign.auth.app-name property in the config-{env}.yaml file to match the DocuSign application name
  2. Assign the generated Integration Key to the docusign.auth.consumer-key property
  3. Assign the generated secret key to the docusign.auth.consumer-secret property (use a secured or hidden deployment property for security reasons)
  4. Assign the callback URI for the deployed application to the docusign.auth.redirect-uri property in the config-{env}.yaml file
  5. To run the application from Studio, assign the local URI to the docusign.auth.redirect-uri property in config-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.

IssuePossible CauseResolution
OAuth authorization dance not yet performed for resourceOwnerId Accelerator-FINSOne 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 NameDescription
api.autodiscoveryIDRequired if using API Manager to secure this API
docusign.accountDocusign 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-keyIntegration Key of the connected app
docusign.auth.consumer-secretSecret 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


Reviews

TypeTemplate
OrganizationMulesoft Inc.
Published by
MuleSoft Solutions
Published onNov 10, 2023
Asset overview

Asset versions for 2.1.x

Asset versions
VersionActions
2.1.3
2.1.2
2.1.1