# Setup

> To successfully establish a connection and send requests to the DocuSign API, the [DocuSign Scope](https://docs.uipath.com/activities/other/latest/legacy-integrations/docusign-scope) activity must complete authentication using the supported [OAuth 2.0 authentication](https://developers.docusign.com/platform/auth/).

To successfully establish a connection and send requests to the DocuSign API, the [DocuSign Scope](https://docs.uipath.com/activities/other/latest/legacy-integrations/docusign-scope) activity must complete authentication using the supported [OAuth 2.0 authentication](https://developers.docusign.com/platform/auth/).

DocuSign supports both [JWT](https://developers.docusign.com/platform/auth/jwt/) and [OAuth](https://developers.docusign.com/platform/auth/) for authentication.

To give the **DocuSign Scope** activity the ability to authenticate and to enable the other activities to successfully send requests to DocuSign API, you must complete the following steps:

After establishing a connection, a parent DocuSign Scope activity can output a record of the connection in a DocuSign Connection object (**DocuSign Connection**) that you can use in subsequent child scope activities.

1. Create an Integration Key.
2. Build your project.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-179816-e8c46ed1-d32cc97c.webp)

## Steps

### 1. Create an Integration Key

The following input properties are required in the **DocuSign Scope** activity:

To get the **Integration Key** value, follow the [JSON Web Token (JWT) Grant](https://developers.docusign.com/platform/auth/jwt/) steps in the DocuSign documentation.

After generating the values, copy the values to enter it as a `SecureString` in the **Integration Key** parameter and a `String` for the **API Username** parameter. Then, enter select the **Environment Type** you wish to run the activities against (either Production or Development).

:::note
If you are using an OAuth 2.0 and for the User Application are using the Authorization Code Grant option, then under Additional Settings you will need to add (**http://127.0.0.1:10001/authorize/**) as one of the Redirect URIs
:::

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-178640-87293e53-cab5e5aa.webp)

### 2: Using JWT

JWT is supported with the release of DocuSign activity pack version 1.1.0. To use JWT you will follow the [How to get an access token with JWT Grant authentication](https://developers.docusign.com/platform/auth/jwt/jwt-get-token/). The format of the JWT file is the following:

```
{
  "typ": "JWT",
  "alg": "RS256",
  "iss": "3662508e-851e-4b16-b5b0-xxxxxxxxxxxx",
  "sub": "0099b00b-990f-4666-98d7-xxxxxxxxxxxx",
   "aud": "account-d.docusign.com",
  "scope": "signature impersonation",
  "privatekey": "your private key text"
}
```

This will be a.json file. The keys and values you want to set are the following:

* "iss" : The integration key (also known as Client ID) of the application.
* "sub" : The API Username in GUID format (email or normal ID won't be sufficient) "aud" : The API environment. Use account-d.docusign.com for development and account.docusign.com is for production. "privatekey" : This is the **Private Key** you created per the DocuSign documentation. This will show up as a single long line of text on most text editors.

:::note
You will need to remove the below statements from the **Private Key** data that you use for the `privatekey` parameter. assignment
```
"-----BEGIN RSA PRIVATE KEY-----"
"-----END RSA PRIVATE KEY-----"
```
:::

### 3. Build your project

1. Create a new automation project.
   1. Open **UiPath Studio**.
   2. Under **New Project**, click **Process** (this opens a **New Blank Process** window).
   3. Enter a project **Name**, **Location**, and **Description**.
   4. Click **Create**.
2. Install the **UiPath.DocuSign.Activities** package.
   1. In the **Design** ribbon, click **Manage Packages** (this opens the **Manage Packages** window).
   2. Under **All Packages**, click **Connect**
   3. In the **Search** bar, enter *DocuSign*.
   4. Click, install and accept the license for the **UiPath.DocuSign.Activities**.
      * For more information about Uipath Studio packages, see [Managing Packages](https://docs.uipath.com/studio/docs/managing-activities-packages) in the Studio Guide.

You're done!

Now that you have completed the setup, you can start adding the DocuSign activities to your project.

To learn more about the DocuSign activities (including example property inputs/outputs), see the [Activities](https://docs.uipath.com/activities/other/latest/legacy-integrations/docusign-activities) page for a complete activity list and links to the activity detail pages.
