### Run Multiple Code Examples (Bash) Source: https://developers.docusign.com/docs/esign-rest-api/quickstart/overview Execute the main Quickstart project which includes Authorization Code Grant and JWT Grant examples. Navigate to the Quickstart folder and run the launcher script. ```bash $ cd $ bash launcher.sh ``` -------------------------------- ### Run code examples from Quickstart or launcher projects Source: https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-focused-view This section lists the available programming languages for running the code examples. Choose the language that best suits your development environment. ```text Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby. ``` -------------------------------- ### Run Authorization Code Grant Embedded Signing Example (Bash) Source: https://developers.docusign.com/docs/esign-rest-api/quickstart/overview Execute the specific Quickstart example for Authorization Code Grant embedded signing. Navigate to the Quick ACG subfolder and run its launcher script. ```bash $ cd /Quick_ACG $ bash launcher.sh ``` -------------------------------- ### Install Node.js SDK from GitHub Source: https://developers.docusign.com/docs/esign-rest-api/sdks/node/setup-and-configuration Clone the docusign-esign-node-client repository from GitHub to download the SDK. Navigate to the directory and run 'npm install' to install dependencies. ```bash npm install ``` -------------------------------- ### Create a permission profile using the eSignature REST API Source: https://developers.docusign.com/docs/esign-rest-api/how-to/permission-profile-creating This code example shows how to create a new permission profile. It is available in multiple languages through our Quickstart or launcher projects. ```bash curl --request POST \ --url https://demo.docusign.net/restapi/v2.1/accounts/{{account_id}}/settings/permission_profiles \ --header "authorization: Bearer {{access_token}}" \ --header 'content-type: application/json' \ --data '{ "name": "My New Permission Profile", "settings": [ { "permission": "AllowApiAccess", "enabled": "true" }, { "permission": "AllowApiSending", "enabled": "true" } ] }' ``` ```csharp using System; using System.Collections.Generic; using DocuSign.eSign.Client; using DocuSign.eSign.Model; namespace Example { public class CreatePermissionProfile { public static void Main(string[] args) { // *** Replace with your values. *** // The account ID associated with your DocuSign account. string accountId = "{accountId}"; // The access token for your DocuSign account. string accessToken = "{accessToken}"; ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi"); apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken); AccountsApi accountsApi = new AccountsApi(apiClient); // Construct the permission profile object PermissionProfile newPermissionProfile = new PermissionProfile(); newPermissionProfile.Name = "My New Permission Profile"; // Define settings for the permission profile List settings = new List(); settings.Add(new PermissionProfileSettings { Permission = "AllowApiAccess", Enabled = "true" }); settings.Add(new PermissionProfileSettings { Permission = "AllowApiSending", Enabled = "true" }); newPermissionProfile.Settings = settings; try { // Call the API to create the permission profile PermissionProfile createdProfile = accountsApi.CreatePermissionProfile(accountId, newPermissionProfile); Console.WriteLine($"Successfully created permission profile: {createdProfile.Name} (ID: {createdProfile.Id})"); } catch (ApiException e) { Console.WriteLine($"Error creating permission profile: {e.Message}"); } } } } ``` ```java import com.docusign.esign.api.AccountsApi; import com.docusign.esign.client.ApiClient; import com.docusign.esign.client.ApiException; import com.docusign.esign.model.PermissionProfile; import com.docusign.esign.model.PermissionProfileSettings; import java.util.ArrayList; import java.util.List; public class CreatePermissionProfile { public static void main(String[] args) { // *** Replace with your values. *** // The account ID associated with your DocuSign account. String accountId = "{accountId}"; // The access token for your DocuSign account. String accessToken = "{accessToken}"; ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi"); apiClient.addDefaultHeader("Authorization", "Bearer " + accessToken); AccountsApi accountsApi = new AccountsApi(apiClient); // Construct the permission profile object PermissionProfile newPermissionProfile = new PermissionProfile(); newPermissionProfile.setName("My New Permission Profile"); // Define settings for the permission profile List settings = new ArrayList<>(); settings.add(new PermissionProfileSettings() .permission("AllowApiAccess") .enabled("true")); settings.add(new PermissionProfileSettings() .permission("AllowApiSending") .enabled("true")); newPermissionProfile.setSettings(settings); try { // Call the API to create the permission profile PermissionProfile createdProfile = accountsApi.createPermissionProfile(accountId, newPermissionProfile); System.out.println("Successfully created permission profile: " + createdProfile.getName() + " (ID: " + createdProfile.getId() + ")"); } catch (ApiException e) { System.err.println("Error creating permission profile: " + e.getMessage()); } } } ``` ```javascript const docusign = require('docusign-esign'); async function createPermissionProfile() { // *** Replace with your values. *** const accountId = '{accountId}'; const accessToken = '{accessToken}'; const apiClient = new docusign.ApiClient(); apiClient.setBasePath('https://demo.docusign.net/restapi'); apiClient.addDefaultHeader('Authorization', 'Bearer ' + accessToken); const accountsApi = new docusign.AccountsApi(apiClient); // Construct the permission profile object const newPermissionProfile = { name: 'My New Permission Profile', settings: [ { permission: 'AllowApiAccess', enabled: 'true' }, { permission: 'AllowApiSending', enabled: 'true' } ] }; try { // Call the API to create the permission profile const createdProfile = await accountsApi.createPermissionProfile(accountId, newPermissionProfile); console.log(`Successfully created permission profile: ${createdProfile.name} (ID: ${createdProfile.id})`); } catch (error) { console.error('Error creating permission profile:', error); } } createPermissionProfile(); ``` ```php setBasePath("https://demo.docusign.net/restapi"); $apiClient->addDefaultHeader("Authorization", "Bearer " . $accessToken); $accountsApi = new DocuSign est_api Api AccountsApi ($apiClient); // Construct the permission profile object $newPermissionProfile = new DocuSign est_api Model PermissionProfile (); $newPermissionProfile->setName("My New Permission Profile"); // Define settings for the permission profile $settings = []; $settings[] = new DocuSign est_api Model PermissionProfileSettings (['permission' => 'AllowApiAccess', 'enabled' => 'true']); $settings[] = new DocuSign est_api Model PermissionProfileSettings (['permission' => 'AllowApiSending', 'enabled' => 'true']); $newPermissionProfile->setSettings($settings); try { // Call the API to create the permission profile $createdProfile = $accountsApi->createPermissionProfile($accountId, $newPermissionProfile); echo "Successfully created permission profile: " . $createdProfile->getName() . " (ID: " . $createdProfile->getId() . ")\n"; } catch ( DocuSign est_api Client \ApiException $e) { echo "Error creating permission profile: " . $e->getMessage() . "\n"; } ?> ``` ```powershell param( [Parameter(Mandatory=$true)] [string]$accountId, [Parameter(Mandatory=$true)] [string]$accessToken ) $apiUrl = "https://demo.docusign.net/restapi/v2.1/accounts/$accountId/settings/permission_profiles" $headers = @{ "Authorization" = "Bearer $accessToken" "Content-Type" = "application/json" } $body = @{ name = "My New Permission Profile" settings = @( @{ permission = "AllowApiAccess" enabled = "true" }, @{ permission = "AllowApiSending" enabled = "true" } ) } $response = Invoke-RestMethod -Uri $apiUrl -Method Post -Headers $headers -Body ($body | ConvertTo-Json) Write-Host "Successfully created permission profile: $($response.name) (ID: $($response.id))" ``` ```python import os from docusign_esign import ApiClient, ApiException, AccountsApi # *** Replace with your values. *** account_id = "{accountId}" access_token = "{accessToken}" api_client = ApiClient("https://demo.docusign.net/restapi") api_client.set_default_header("Authorization", "Bearer " + access_token) accounts_api = AccountsApi(api_client) # Construct the permission profile object new_permission_profile = { "name": "My New Permission Profile", "settings": [ { "permission": "AllowApiAccess", "enabled": "true" }, { "permission": "AllowApiSending", "enabled": "true" } ] } try: # Call the API to create the permission profile created_profile = accounts_api.create_permission_profile(account_id, new_permission_profile) print(f"Successfully created permission profile: {created_profile.name} (ID: {created_profile.id})") except ApiException as e: print(f"Error creating permission profile: {e}") ``` ```ruby require 'docusign_esign' # *** Replace with your values. *** account_id = '{accountId}' access_token = '{accessToken}' api_client = DocuSign_esign::ApiClient.new api_client.configure do |config| config.host = 'https://demo.docusign.net/restapi' config.debugging = true end # Set the access token access_token = "Bearer #{access_token}" api_client.default_headers['Authorization'] = access_token accounts_api = DocuSign_esign::AccountsApi.new(api_client) # Construct the permission profile object new_permission_profile = { "name" => "My New Permission Profile", "settings" => [ { "permission" => "AllowApiAccess", "enabled" => "true" }, { "permission" => "AllowApiSending", "enabled" => "true" } ] } begin # Call the API to create the permission profile created_profile = accounts_api.create_permission_profile(account_id, new_permission_profile) puts "Successfully created permission profile: #{created_profile.name} (ID: #{created_profile.id})" rescue DocuSign_esign::ApiException => e puts "Error creating permission profile: #{e.message}" end ``` -------------------------------- ### POST Request Example Source: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeemailsettings/create?explorer=true Example of a POST request to the email_settings endpoint. ```http POST /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/email_settings ``` -------------------------------- ### Install Node.js SDK via Console Source: https://developers.docusign.com/docs/esign-rest-api/sdks/node/setup-and-configuration Install the latest stable version of the Node.js eSignature SDK using npm. To install a specific version, use the '@' syntax. ```bash npm i -s docusign-esign ``` ```bash npm i -s docusign-esign@5.8.1 ``` -------------------------------- ### Example SigningConfiguration Object Source: https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/embedding/docusign-js-embedded-reference An example of how to structure the SigningConfiguration object, including style options. ```javascript const signingConfiguration = { url: recipientViewUrl, displayFormat: 'focused', style: { branding: { primaryButton: { backgroundColor: 'purple', color: 'white' } }, signingNavigationButton: { finishText: 'Submit', position: 'bottom-right' }, signingDeclineButton: { show: true, // default value is false finishText: 'Decline Button Text' }, declineModal: { show: true // default value is false }, downloadModal: { show: true // default value is false } } } ``` -------------------------------- ### SigningConfiguration Object Example Source: https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/embedding/docusign-js-embedded-reference A complete example of a configuration object including branding, navigation, decline buttons, and modal settings. ```javascript const signingConfiguration = { url: recipientViewUrl, displayFormat: 'focused', style: { branding: { primaryButton: { backgroundColor: 'purple', color: 'white' } }, signingNavigationButton: { finishText: 'Submit', position: 'bottom-right' }, signingDeclineButton: { show: true, // default value is false finishText: 'Decline Button Text' }, declineModal: { show: true // default value is false }, downloadModal: { show: true // default value is false } } } ``` -------------------------------- ### Install Python SDK via pip Source: https://developers.docusign.com/docs/esign-rest-api/sdks/python/setup-and-configuration Use the command line to install the latest stable version of the SDK from PyPI. ```bash pip install docusign-esign ``` -------------------------------- ### Retrieve Envelope Data via cURL Source: https://developers.docusign.com/docs/esign-rest-api/how-to/get-envelope-information Example command to perform a GET request for envelope details using the REST API. ```Bash curl --header "Authorization: Bearer ${ACCESS_TOKEN} " \ --header "Content-Type: application/json" \ --request GET ${base_path}/v2.1/accounts/$ {account_id}/envelopes/${envelope_id} ``` -------------------------------- ### Create Signable HTML Document Example Source: https://developers.docusign.com/docs/esign-rest-api/how-to/creating-signable-html This example demonstrates how to send HTML code directly to create a document for responsive signing. It is available in multiple programming languages. ```Bash Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby. ``` -------------------------------- ### GET /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/attachments Source: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeattachments/list Returns a list of envelope attachments associated with a specified envelope. It's easy to confuse envelope attachments, which are developer-only files associated with an envelope, with signer attachments. To get a list of user-visible attachments, use EnvelopeDocuments: get. To learn about the different types of attachments, see Attachments in the concept guide. ```APIDOC ## GET /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/attachments ### Description Returns a list of envelope attachments associated with a specified envelope. It's easy to confuse envelope attachments, which are developer-only files associated with an envelope, with signer attachments. To get a list of user-visible attachments, use EnvelopeDocuments: get. To learn about the different types of attachments, see Attachments in the concept guide. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/attachments ### Parameters #### Path Parameters - **accountId** (string) - Required - The external account number (int) or account ID GUID. - **envelopeId** (string) - Required - The envelope's GUID. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec` ### Responses #### Success Response (200) - **(response body)** - Successful response. #### Error Response (400) - **(response body)** - Error encountered. ``` -------------------------------- ### Retrieve Envelope Status JSON Response Source: https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/recipients/scheduled-sending Example of the JSON structure returned by an Envelopes:get call, illustrating the envelope, workflow, and scheduled sending status fields. ```json { "status": "created", "workflow": { "resumeDate": "2022-03-07T16:30:00.0000000Z", "workflowStatus": "scheduled", "scheduledSending": { "status": "started", "resumeDate": "2022-03-07T16:30:00.0000000Z", "rules": [ { "resumeDate": "2022-03-07T16:30:00.0000000Z" } ] }, "currentWorkflowStepId": "", "workflowSteps": [] } } ``` -------------------------------- ### Instantiate and configure ApiClient Source: https://developers.docusign.com/docs/esign-rest-api/sdks/ruby/auth Sets up the configuration, base path, authorization headers, and initializes the EnvelopesApi. ```ruby configuration = Docusign_eSign::Configuration.new configuration.host = base_path api_client = Docusign_eSign::ApiClient.new configuration api_client.default_headers['Authorization'] = "Bearer #{access_token}" envelopes_api = Docusign_eSign::EnvelopesApi.new api_client ``` -------------------------------- ### GET /restapi/v2.1/accounts/{accountId}/users/{userId} Source: https://developers.docusign.com/docs/esign-rest-api/reference/users/users/get?explorer=true Retrieves information for a specific user identified by their userId (GUID). This endpoint can also be used to find a user by their email address by utilizing the list endpoint. ```APIDOC ## GET /restapi/v2.1/accounts/{accountId}/users/{userId} ### Description Gets the user information for a specified user using a userId (GUID). To find a user based on their email address, use the list endpoint. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/users/{userId} ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. - **userId** (string) - Required - The ID of the user. #### Query Parameters - **additional_info** (string) - Optional - Specifies whether to include additional user information. - **email** (string) - Optional - The email address of the user to find. - **include_license** (string) - Optional - Specifies whether to include license information. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Example of Violating API Request Limits Source: https://developers.docusign.com/docs/esign-rest-api/esign101/rules-and-limits This sequence of requests demonstrates a pattern that violates API rules due to repeated GET requests within short intervals. Such patterns can lead to rate limit errors. ```text [12:00:00] POST /accounts/12345/envelopes [12:01:00] GET /accounts/12345/envelopes/AAA/documents/1 [12:02:00] GET /accounts/12345/envelopes/AAA/recipients/2 [12:03:00] POST /accounts/12345/envelopes [12:04:00] GET /accounts/12345/envelopes/AAA/documents/1 * [12:05:00] GET /accounts/12345/envelopes/AAA/recipients/2 * ``` -------------------------------- ### Code example launchers overview Source: https://developers.docusign.com/docs/esign-rest-api/how-to/code-launchers These launchers are complete projects demonstrating common Docusign eSignature API integration functions. They are available in multiple SDKs and languages, including C#, Java, Node.js, PHP, Python, Ruby, Bash, and PowerShell. -------------------------------- ### Envelopes: listStatus PUT Request Example Source: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/liststatus Use this PUT request to retrieve envelope statuses by providing envelope IDs in the request body. This method returns a smaller subset of envelope information compared to the GET implementation. ```json { "envelopeIds": [ "44c5ad6c-xxxx-xxxx-xxxx-ebda5e2dfe15", "8e26040d-xxxx-xxxx-xxxx-1e29b924d237", "c8b40a2d-xxxx-xxxx-xxxx-4fe56fe10f95" ] } ``` -------------------------------- ### GET /restapi/v2.1/accounts/{accountId}/groups Source: https://developers.docusign.com/docs/esign-rest-api/reference/usergroups/groups/list Gets information about groups associated with the account. To get the users in a group, first use this endpoint to get the group ID, then use listGroupUsers. ```APIDOC ## GET /restapi/v2.1/accounts/{accountId}/groups ### Description Gets information about groups associated with the account. To get the users in a group, first use this endpoint to get the group ID, then use listGroupUsers. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/groups ### Parameters #### Path Parameters - **accountId** (string) - Required - The external account number (int) or account ID GUID. #### Query Parameters - **count** (string) - Optional - The maximum number of results to return. Use `start_position` to specify the number of results to skip. Valid values: `1` to `100` - **group_type** (string) - Optional - The type of group to return. Valid values: `AdminGroup`, `CustomGroup`, `EveryoneGroup` - **include_usercount** (string) - Optional - When **true,** every group returned in the response includes a `userCount` property that contains the total number of users in the group. The default is **true.** - **search_text** (string) - Optional - Filters the results of a GET request based on the text that you specify. - **start_position** (string) - Optional - The zero-based index of the result from which to start returning results. Use with `count` to limit the number of results. The default value is `0`. ### Responses #### Success Response (200) - **groups** (array) - A list of groups associated with the account. - **groupId** (string) - The ID of the group. - **groupName** (string) - The name of the group. - **groupType** (string) - The type of the group. - **userCount** (integer) - The number of users in the group (only if `include_usercount` is true). #### Error Response (400) - **errorCode** (string) - The error code. - **message** (string) - A description of the error. ``` -------------------------------- ### Create Responsive HTML Preview for Template Document Source: https://developers.docusign.com/docs/esign-rest-api/reference/templates/templatedocumentresponsivehtmlpreview Use this POST method to create a preview of the responsive version of a template document. Ensure that responsive signing is enabled in your account settings. ```bash POST /restapi/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/responsive_html_preview ``` -------------------------------- ### GET /documents Source: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopedocuments/list?explorer=true Gets a list of documents in an envelope. ```APIDOC ## GET /documents ### Description Gets a list of documents in an envelope. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. - **envelopeId** (string) - Required - The ID of the envelope. #### Query Parameters - **documents_by_userid** (string) - Optional - - **include_agreement_type** (string) - Optional - - **include_docgen_formfields** (string) - Optional - - **include_metadata** (string) - Optional - - **include_tabs** (string) - Optional - - **recipient_id** (string) - Optional - - **shared_user_id** (string) - Optional - ### Response #### Success Response (200) - **documents** (array) - Description - **document_id** (string) - Description - **uri** (string) - Description - **name** (string) - Description - **file_extension** (string) - Description - **size** (string) - Description - **order** (string) - Description #### Response Example { "documents": [ { "document_id": "string", "uri": "string", "name": "string", "file_extension": "string", "size": "string", "order": "string" } ] } ``` -------------------------------- ### Instantiate a model with properties in Ruby Source: https://developers.docusign.com/docs/esign-rest-api/sdks/ruby/accessing-object-model Shows how to initialize a new Brand object with multiple properties simultaneously. ```ruby brand = Docusign_eSign::Brand.new({ brandName: 'My Brand', defaultBrandLanguage: 'en', colors = my_brand_colors }) ``` -------------------------------- ### Create Template Responsive HTML Preview Source: https://developers.docusign.com/docs/esign-rest-api/reference/templates/templateresponsivehtmlpreview Use this method to create a preview of the responsive versions of documents associated with a template. Responsive Signing must be enabled on the account. ```bash POST /restapi/v2.1/accounts/{accountId}/templates/{templateId}/responsive_html_preview ``` -------------------------------- ### Instantiate and configure ApiClient Source: https://developers.docusign.com/docs/esign-rest-api/sdks/python/auth Initialize the ApiClient, set the host base path, and configure the Authorization header for subsequent API calls. ```python api_client = ApiClient() api_client.host = base_path api_client.set_default_header(header_name=”Authorization”, header_value=f”Bearer {access_token}”) envelopes_api = EnvelopesApi(api_client) ``` -------------------------------- ### GET /restapi/v2.1/accounts/{accountId}/tab_definitions Source: https://developers.docusign.com/docs/esign-rest-api/reference/customtabs/customtabs/list?explorer=true Gets a list of all account tabs. ```APIDOC ## GET /restapi/v2.1/accounts/{accountId}/tab_definitions ### Description Gets a list of all account tabs. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/tab_definitions ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. #### Query Parameters - **custom_tab_only** (string) - Optional - Filters tabs to only include custom tabs. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **tabDefinitions** (array) - A list of tab definitions. - **customTabId** (string) - The ID of the custom tab. - **name** (string) - The name of the tab. - **type** (string) - The type of the tab. #### Response Example ```json { "tabDefinitions": [ { "customTabId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "My Custom Tab", "type": "SignHere" } ] } ``` ``` -------------------------------- ### GET /restapi/v2.1/accounts/{accountId}/permission_profiles Source: https://developers.docusign.com/docs/esign-rest-api/reference/accounts/accountpermissionprofiles Gets a list of permission profiles. ```APIDOC ## GET /restapi/v2.1/accounts/{accountId}/permission_profiles ### Description Gets a list of permission profiles. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/permission_profiles ### Parameters #### Path Parameters - **accountId** (string) - Required - The account ID. ``` -------------------------------- ### Instantiate ApiClient and Configuration in PHP Source: https://developers.docusign.com/docs/esign-rest-api/sdks/php/auth This PHP code demonstrates how to instantiate the `ApiClient` and `Configuration` objects for making eSignature REST API calls. It sets the base path and authorization header. ```php $config = new Configuration(); $config->setHost($args['base_path']); $config->addDefaultHeader('Authorization', 'Bearer ' . $args['ds_access_token']); $this->apiClient = new ApiClient($config); return new EnvelopesApi($this->apiClient); ``` -------------------------------- ### Instantiate Configuration Object in PHP Source: https://developers.docusign.com/docs/esign-rest-api/sdks/php/auth This PHP snippet shows how to create a `Configuration` object, which holds settings for the API client. ```php $config = new Configuration(); ``` -------------------------------- ### Instantiate a C# SDK Model with Constructor Source: https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/accessing-object-model Example of creating a new C# SDK model object and initializing multiple properties using its constructor. This is a concise way to set initial values for an object. ```csharp Brand brand = new Brand { BrandName = "My Brand", DefaultBrandLanguage = "en", Colors = myBrandColors }; ``` -------------------------------- ### Install Docusign Ruby eSignature Gem via Console Source: https://developers.docusign.com/docs/esign-rest-api/sdks/ruby/setup-and-configuration Install the docusign_esign gem directly from your console. You can install the latest version or a specific version using the -v switch. ```bash gem install docusign_esign ``` ```bash gem install docusign_esign -v 3.5.0 ``` -------------------------------- ### GET /restapi/v2/accounts/{accountId}/envelopes/{envelopeId} Source: https://developers.docusign.com/docs/esign-rest-api/v2/reference/envelopes/envelopes Gets the status of a single envelope. ```APIDOC ## GET /restapi/v2/accounts/{accountId}/envelopes/{envelopeId} ### Description Gets the status of a single envelope. ### Method GET ### Endpoint /restapi/v2/accounts/{accountId}/envelopes/{envelopeId} ### Parameters #### Path Parameters - **accountId** (string) - Required - The account ID. - **envelopeId** (string) - Required - The envelope ID. ``` -------------------------------- ### Instantiate Configuration object Source: https://developers.docusign.com/docs/esign-rest-api/sdks/ruby/auth Creates a new configuration instance to hold API settings. ```ruby configuration = Docusign_eSign::Configuration.new ``` -------------------------------- ### Build and Install Docusign Ruby eSignature Gem from Source Source: https://developers.docusign.com/docs/esign-rest-api/sdks/ruby/setup-and-configuration Download or clone the SDK from GitHub, then build and install the gem locally. This is useful if you intend to modify the SDK. ```bash gem build docusign_esign.gemspec ``` ```bash gem install docusign_esign-3.9.0.gem ``` -------------------------------- ### GET Envelopes Source: https://developers.docusign.com/docs/esign-rest-api/v2/reference/envelopes/envelopes/get?explorer=true Gets the status of a single envelope. Requires accountId and envelopeId. ```APIDOC ## GET /restapi/v2/accounts/{accountId}/envelopes/{envelopeId} ### Description Gets the status of a single envelope. ### Method GET ### Endpoint /restapi/v2/accounts/{accountId}/envelopes/{envelopeId} ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. - **envelopeId** (string) - Required - The ID of the envelope. #### Query Parameters - **advanced_update** (string) - Optional - Specifies if advanced update options are used. - **include** (string) - Optional - Specifies additional information to include in the response. ### Response #### Success Response (200) - **envelopeId** (string) - The ID of the envelope. - **status** (string) - The status of the envelope. #### Response Example { "envelopeId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "status": "Sent" } ``` -------------------------------- ### EnvelopeConsumerDisclosures GET Source: https://developers.docusign.com/docs/esign-rest-api/v2/reference/envelopes/envelopeconsumerdisclosures/get?explorer=true Gets the Electronic Record and Signature Disclosure associated with the account. ```APIDOC ## GET /restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/consumer_disclosure/{langCode} ### Description Gets the Electronic Record and Signature Disclosure associated with the account. ### Method GET ### Endpoint /restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/consumer_disclosure/{langCode} ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. - **envelopeId** (string) - Required - The ID of the envelope. - **recipientId** (string) - Required - The ID of the recipient. - **langCode** (string) - Required - The language code for the disclosure. ### Response #### Success Response (200) - **field1** (type) - Description ``` -------------------------------- ### GET /restapi/v2/accounts/{accountId}/connect/failures Source: https://developers.docusign.com/docs/esign-rest-api/v2/reference/connect/connectevents Gets the Connect failure log information. ```APIDOC ## GET /restapi/v2/accounts/{accountId}/connect/failures ### Description Gets the Connect failure log information. ### Method GET ### Endpoint /restapi/v2/accounts/{accountId}/connect/failures ### Parameters #### Path Parameters - **accountId** (string) - Required - The account ID. ``` -------------------------------- ### Create an Agent User Source: https://developers.docusign.com/docs/esign-rest-api/how-to/shared-access Sends a POST request to create a new user with an activation access code. ```Bash printf \ '{ "newUsers": [ { "activationAccessCode": "'"${ACTIVATION}"'", "userName": "'"${AGENT_NAME}"'", "email": "'"${AGENT_EMAIL}"'" } ] }' >> $request_data Status=$(curl --request POST ${base_path}/v2.1/ accounts/${ACCOUNT_ID}/users \ "${Headers[@]}" \ --data-binary @${request_data} \ --output ${response}) echo "" echo "Response: " cat $response ``` -------------------------------- ### GET /restapi/v2/accounts/{accountId}/billing_payments Source: https://developers.docusign.com/docs/esign-rest-api/v2/reference/billing/payments/list?explorer=true Gets payment information for one or more payments. ```APIDOC ## GET /restapi/v2/accounts/{accountId}/billing_payments ### Description Gets payment information for one or more payments. ### Method GET ### Endpoint /restapi/v2/accounts/{accountId}/billing_payments ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. #### Query Parameters - **from_date** (string) - Optional - The start date for the payment search. - **to_date** (string) - Optional - The end date for the payment search. ### Response #### Success Response (200) - **payments** (array) - A list of payment objects. - **payment_id** (string) - The ID of the payment. - **payment_date** (string) - The date the payment was made. - **amount** (string) - The amount of the payment. - **status** (string) - The status of the payment. #### Response Example ```json { "payments": [ { "payment_id": "123e4567-e89b-12d3-a456-426614174000", "payment_date": "2023-10-27T10:00:00Z", "amount": "100.00", "status": "Success" } ] } ``` ``` -------------------------------- ### Instantiate a Brand Object Source: https://developers.docusign.com/docs/esign-rest-api/sdks/node/accessing-object-model Shows how to initialize a new Brand object with multiple properties simultaneously using a constructor-like object literal. ```javascript const brand = { brandName: "My Brand", defaultBrandLanguage: "en" } ``` -------------------------------- ### Configure Docusign OWIN Startup for ASP.NET MVC Source: https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/auth This `ConfigureAuth()` method in `DSOwinStartup.cs` sets up the DocuSign authentication middleware for ASP.NET MVC applications using OWIN. It requires `Microsoft.Owin` NuGet package and configuration for ClientId, ClientSecret, and other endpoints. ```csharp public void ConfigureAuth(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions()); app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); app.Use(typeof(DocusignAuthenticationMiddleware), app, new DocusignAuthenticationOptions { ClientId = ConfigurationManager.AppSettings["IntegrationKey"], ClientSecret = ConfigurationManager.AppSettings["SecretKey"], AuthorizationEndpoint = "https://account-d.docusign.com/oauth/auth", TokenEndpoint = "https://account-d.docusign.com/oauth/token", UserInformationEndpoint = "https://account-d.docusign.com/oauth/userinfo", AppUrl = ConfigurationManager.AppSettings["AppUrl"], CallbackPath = new PathString("/ds/Callback") }); } ``` -------------------------------- ### GET /restapi/v2.1/accounts/{accountId}/groups Source: https://developers.docusign.com/docs/esign-rest-api/reference/usergroups/groups Gets information about groups associated with the account. ```APIDOC ## GET /restapi/v2.1/accounts/{accountId}/groups ### Description Gets information about groups associated with the account. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/groups ### Parameters #### Path Parameters - **accountId** (string) - Required - The account ID associated with the request. ``` -------------------------------- ### GET /accounts/{accountId}/envelopes/{envelopeId} Source: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/get?explorer=true Gets the status of a single envelope. ```APIDOC ## GET /accounts/{accountId}/envelopes/{envelopeId} ### Description Gets the status of a single envelope. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId} ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. - **envelopeId** (string) - Required - The ID of the envelope. #### Query Parameters - **advanced_update** (string) - Optional - - **include** (string) - Optional - - **include_anchor_tab_locations** (string) - Optional - - **user_id** (string) - Optional - ### Response #### Success Response (200) - **Get Response** (object) - Description ``` -------------------------------- ### Get Connect Configuration Details Source: https://developers.docusign.com/docs/esign-rest-api/reference/connect/connectconfigurations/get?explorer=true Retrieves the details for a specific Connect configuration. Requires account ID and connect ID. ```bash GET /restapi/v2.1/accounts/{accountId}/connect/{connectId} ``` -------------------------------- ### GET /accounts/{accountId}/signatureProviders Source: https://developers.docusign.com/docs/esign-rest-api/reference/accounts/accountsignatureproviders/list?explorer=true Gets the available signature providers for an account. ```APIDOC ## GET /accounts/{accountId}/signatureProviders ### Description Gets the available signature providers for an account. ### Method GET ### Endpoint /restapi/v2.1/accounts/{accountId}/signatureProviders ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **signatureProviders** (array) - A list of signature providers available for the account. - **displayName** (string) - The display name of the signature provider. - **is21CFRPart11Compliant** (string) - Indicates if the signature provider is compliant with 21 CFR Part 11. - **signatureProviderId** (string) - The unique identifier for the signature provider. - **tpIntegrationKey** (string) - The TP integration key for the signature provider. - **tpTemplateId** (string) - The TP template ID for the signature provider. #### Response Example ```json { "signatureProviders": [ { "displayName": "Example Provider", "is21CFRPart11Compliant": "true", "signatureProviderId": "123e4567-e89b-12d3-a456-426614174000", "tpIntegrationKey": "tp_key_123", "tpTemplateId": "tp_template_456" } ] } ``` ``` -------------------------------- ### GET /restapi/v2/accounts/{accountId}/users/{userId} Source: https://developers.docusign.com/docs/esign-rest-api/v2/reference/users/users Gets the user information for a specified user. ```APIDOC ## GET /restapi/v2/accounts/{accountId}/users/{userId} ### Description Gets the user information for a specified user. ### Method GET ### Endpoint /restapi/v2/accounts/{accountId}/users/{userId} ### Parameters #### Path Parameters - **accountId** (string) - Required - The account ID. - **userId** (string) - Required - The user ID. ``` -------------------------------- ### Schedule an envelope Source: https://developers.docusign.com/docs/esign-rest-api/how-to/schedule-an-envelope This code example shows how to schedule an envelope for sending. It is available in multiple languages. ```Bash curl --request POST \ --url https://demo.docusign.net/restapi/v2.1/accounts/{{ACCOUNT_ID}}/envelopes/scheduled_sending/batch \ --header "authorization: Bearer {{ACCESS_TOKEN}}" \ --header 'content-type: application/json' \ --data '{ "envelopes": [ { "envelopeId": "{{ENVELOPE_ID}}", "scheduledSendDate": "2023-10-26T10:00:00Z" } ] }' ``` ```C# var envelope = new ScheduledEnvelope() { EnvelopeId = "{{ENVELOPE_ID}}", ScheduledSendDate = "2023-10-26T10:00:00Z" }; var envelopes = new List() { envelope }; var batch = new BatchEnvelopeRequest() { Envelopes = envelopes }; var results = envelopesApi.BatchScheduleSend(accountId, batch); ``` ```Java ScheduledEnvelope envelope = new ScheduledEnvelope(); envelope.setEnvelopeId("{{ENVELOPE_ID}}"); envelope.setScheduledSendDate("2023-10-26T10:00:00Z"); List envelopes = new ArrayList<>(); envelopes.add(envelope); BatchEnvelopeRequest batch = new BatchEnvelopeRequest(); batch.setEnvelopes(envelopes); BatchEnvelopeResponse results = envelopesApi.batchScheduleSend(accountId, batch); ``` ```Node.js const envelope = { envelopeId: "{{ENVELOPE_ID}}", scheduledSendDate: "2023-10-26T10:00:00Z" }; const envelopes = [envelope]; const batch = { envelopes: envelopes }; const results = await envelopesApi.batchScheduleSend(accountId, batch); ``` ```PHP $envelope = new DocuSign \eSign\Model\ScheduledEnvelope(); $envelope->setEnvelopeId("{{ENVELOPE_ID}}"); $envelope->setScheduledSendDate("2023-10-26T10:00:00Z"); $envelopes = array($envelope); $batch = new DocuSign \eSign\Model\BatchEnvelopeRequest(); $batch->setEnvelopes($envelopes); $results = $envelopesApi->batchScheduleSend($accountId, $batch); ``` ```PowerShell $envelope = New-Object DocuSign .eSign.Client.ScheduledEnvelope $envelope.EnvelopeId = "{{ENVELOPE_ID}}" $envelope.ScheduledSendDate = "2023-10-26T10:00:00Z" $envelopes = @($envelope) $batch = New-Object DocuSign .eSign.Client.BatchEnvelopeRequest $batch.Envelopes = $envelopes $results = $envelopesApi.BatchScheduleSend($accountId, $batch) ``` ```Python envelope = { "envelopeId": "{{ENVELOPE_ID}}", "scheduledSendDate": "2023-10-26T10:00:00Z" } envelopes = [envelope] batch = { "envelopes": envelopes } results = envelopes_api.batch_schedule_send(account_id, batch) ``` ```Ruby envelope = { envelopeId: "{{ENVELOPE_ID}}", scheduledSendDate: "2023-10-26T10:00:00Z" } envelopes = [envelope] batch = { envelopes: envelopes } results = envelopes_api.batch_schedule_send(account_id, batch) ``` -------------------------------- ### Instantiate ApiClient object Source: https://developers.docusign.com/docs/esign-rest-api/sdks/ruby/auth Initializes the ApiClient using the provided configuration object. ```ruby api_client = Docusign_eSign::ApiClient.new configuration ``` -------------------------------- ### GET /restapi/v2/accounts/{accountId}/groups/{groupId}/users Source: https://developers.docusign.com/docs/esign-rest-api/v2/reference/usergroups/groupusers Gets a list of users in a group. ```APIDOC ## GET /restapi/v2/accounts/{accountId}/groups/{groupId}/users ### Description Gets a list of users in a group. ### Method GET ### Endpoint /restapi/v2/accounts/{accountId}/groups/{groupId}/users ### Parameters #### Path Parameters - **accountId** (string) - Required - The account ID associated with the request. - **groupId** (string) - Required - The ID of the group to retrieve users from. ``` -------------------------------- ### Instantiate a Brand object in Python Source: https://developers.docusign.com/docs/esign-rest-api/sdks/python/accessing-object-model Initialize a new Brand object with multiple properties using the constructor. ```python brand = Brand( brand_name="My Brand", default_brand_language="en", colors=myBrandColors ) ``` -------------------------------- ### GET /accounts/{accountId}/templates/{templateId}/recipients Source: https://developers.docusign.com/docs/esign-rest-api/v2/reference/templates/templaterecipients/list?explorer=true Gets recipient information from a template. ```APIDOC ## GET /accounts/{accountId}/templates/{templateId}/recipients ### Description Gets recipient information from a template. ### Method GET ### Endpoint /restapi/v2/accounts/{accountId}/templates/{templateId}/recipients ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. - **templateId** (string) - Required - The ID of the template. #### Query Parameters - **include_anchor_tab_locations** (string) - Optional - Specifies whether to include anchor tab locations. - **include_extended** (string) - Optional - Specifies whether to include extended information. - **include_tabs** (string) - Optional - Specifies whether to include tabs. ### Response #### Success Response (200) - **recipients** (array) - A list of recipients associated with the template. - **recipientId** (string) - The ID of the recipient. - **type** (string) - The type of the recipient. - **email** (string) - The email address of the recipient. - **name** (string) - The name of the recipient. - **tabs** (object) - Information about the tabs assigned to the recipient. #### Response Example ```json { "recipients": [ { "recipientId": "123e4567-e89b-12d3-a456-426614174000", "type": "Signer", "email": "test@example.com", "name": "Test User", "tabs": { "signHereTabs": [ { "tabLabel": "Signature" } ] } } ] } ``` ```