### API Dashboard and Quickstart Source: https://developers.hellosign.com/index Information on accessing the API Dashboard for further insights and using the Quickstart guide to get started with the Dropbox Sign API. ```APIDOC ## API Dashboard Please visit our [API Dashboard Guide](link-to-api-dashboard-guide) for more information. ## Quickstart Ready to take your first steps with the Dropbox Sign API? We now offer an updated and interactive Quickstart guide that will introduce you to the Dropbox Sign API. Upon completion of the Quickstart guide, you should feel pretty comfortable sending signature requests! We also recommend using the _Try it console_ to send API calls directly from the endpoint you'd like to further explore. ``` -------------------------------- ### Install Dropbox Sign Python SDK from PyPI Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Installs the new Dropbox Sign Python SDK using pip from the Python Package Index (PyPI). This is the recommended method for most users. ```python python -m pip install dropbox-sign ``` -------------------------------- ### Install Node SDK using NPM Source: https://developers.hellosign.com/docs/sdks/node/migration-guide Installs the new Dropbox Sign Node.js SDK from NPM. This is the recommended method for adding the SDK to your project. ```bash npm init npm install @dropbox/sign ``` -------------------------------- ### Install Dropbox Sign Python SDK from GitHub Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Installs the new Dropbox Sign Python SDK directly from its GitHub repository using pip. This is useful for installing the latest development versions. ```python python -m pip install git+https://github.com/hellosign/dropbox-sign-python.git ``` -------------------------------- ### Install Dropbox.Sign SDK with NuGet Package Manager Source: https://developers.hellosign.com/docs/sdks/dotnet/migration-guide This command installs the latest version of the Dropbox.Sign SDK using the NuGet package manager. Ensure you have the .NET SDK installed and configured. ```bash dotnet add package Dropbox.Sign --version 1.0.0 ``` -------------------------------- ### Get Account Info with Dropbox Sign SDK Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Retrieves account information using the Dropbox Sign SDK. This example shows how to initialize the client and fetch account details. It requires an API key for authentication. ```python hs_client = HSClient(api_key="your_api_key") account = hs_client.get_account_info() print hs_client.account.email_address ``` ```python from pprint import pprint from dropbox_sign import \ ApiClient, ApiException, Configuration, apis configuration = Configuration( username="YOUR_API_KEY", ) with ApiClient(configuration) as api_client: account_api = apis.AccountApi(api_client) try: response = account_api.account_get() pprint(response) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` -------------------------------- ### Send Signature Request (Basic) Source: https://developers.hellosign.com/docs/sdks/python/migration-guide This example demonstrates how to send a basic signature request using the legacy SDK. ```APIDOC ## POST /signature_request ### Description Sends a signature request to one or more signers. ### Method POST ### Endpoint /signature_request ### Parameters #### Request Body - **test_mode** (boolean) - Optional - Whether to send in test mode. - **title** (string) - Required - The title of the signature request. - **subject** (string) - Optional - The subject of the email sent to the signers. - **message** (string) - Optional - The message to include in the email sent to the signers. - **signers** (array) - Required - An array of signer objects. - **email_address** (string) - Required - The email address of the signer. - **name** (string) - Required - The name of the signer. - **order** (integer) - Optional - The signing order of the signer. - **cc_email_addresses** (array) - Optional - An array of email addresses to CC on the signature request. - **files** (array) - Optional - An array of file paths for the documents to be signed. - **file_urls** (array) - Optional - An array of URLs for the documents to be signed. - **metadata** (object) - Optional - A key-value map of custom data. ### Request Example ```json { "test_mode": true, "title": "NDA with Acme Co.", "subject": "The NDA we talked about", "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", "signers": [ { "email_address": "jack@example.com", "name": "Jack", "order": 0 }, { "email_address": "jill@example.com", "name": "Jill", "order": 1 } ], "cc_email_addresses": ["lawyer@dropboxsign.com", "lawyer@example.com"], "files": ["NDA.pdf", "AppendixA.pdf"], "metadata": { "client_id": "1234", "custom_text": "NDA #9" } } ``` ### Response #### Success Response (200) - **signature_request_id** (string) - The ID of the signature request. - **status** (string) - The status of the signature request. #### Response Example ```json { "signature_request_id": "1234567890abcdef1234567890abcdef", "status": "sent" } ``` ``` -------------------------------- ### Get Fax Line - TypeScript Source: https://developers.hellosign.com/api/reference/operation/faxLineGet A TypeScript example for retrieving fax line details. Ensure you have the Dropbox Sign TypeScript SDK installed and configured with your API key. ```typescript import { ApiClient, Configuration, FaxLineApi } from "@hellosign/openapi-typescript-sdk"; async function getFaxLineDetails(apiKey: string, faxNumber: string) { const configuration = new Configuration({ baseOptions: { headers: { 'Authorization': `Basic ${apiKey}` } } }); const apiClient = new ApiClient(configuration); const faxLineApi = new FaxLineApi(apiClient); try { const response = await faxLineApi.faxLineGet({ number: faxNumber }); console.log("Fax Line Details:", response.data); return response.data; } catch (error) { console.error("Error fetching fax line details:", error); throw error; } } // Example usage: const apiKey = "YOUR_API_KEY"; const faxNumber = "[FAX_NUMBER]"; getFaxLineDetails(apiKey, faxNumber) .then(data => console.log("Successfully retrieved fax line.")) .catch(err => console.error("Failed to retrieve fax line.")); ``` -------------------------------- ### Instantiating Form Field Classes Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Demonstrates different ways to instantiate form field classes for the HelloSign API, including using a base class, the `.init()` method, or direct instantiation. ```APIDOC ## Form Field Class Instantiation ### Description This section details how to instantiate the correct form field object when making an API request, offering three primary methods: using `SubFormFieldsPerDocumentBase`, the `.init()` method, or direct class instantiation. ### Methods #### 1. Using `SubFormFieldsPerDocumentBase` This base class can automatically instantiate the correct field object based on the `type` parameter. ```python # instantiates a new `SubFormFieldsPerDocumentSignature` object form_fields_per_document_signature = models.SubFormFieldsPerDocumentBase( type="signature", document_index=0, api_id="4688957689", name="signature1", x=5, y=7, width=60, height=30, required=True, signer=0, page=1, ) ``` #### 2. Using `.init()` Method The `.init()` method allows you to initialize request objects, including form fields, from a dictionary. ```python # instantiates a new `SignatureRequestSendRequest` object data = models.SignatureRequestSendRequest.init({ "test_mode": True, "files": [open("pdf-sample.pdf", "rb")], "title": "NDA with Acme Co.", "subject": "The NDA we talked about", "message": "Please sign this NDA and then we can discuss more.", "signers": [ { "email_address": "jill@example.com", "name": "Jill", "order": 1 } ], # instantiates a new `SubFormFieldsPerDocumentSignature` object "form_fields_per_document": [ { "type": "signature", "document_index": 0, "api_id": "4688957689", "name": "signature1", "x": 5, "y": 7, "width": 60, "height": 30, "required": True, "signer": 0, "page": 1, } ] }) ``` #### 3. Direct Class Instantiation You can instantiate the specific field class directly. ```python # Example for direct instantiation of SubFormFieldsPerDocumentSignature form_field = models.SubFormFieldsPerDocumentSignature( document_index=0, api_id="1234", name="signer_name", type="signature", x=100, y=100, page=1, width=100, height=50, required=True, signer=0 ) ``` ### Available Field Types and Classes | Field Type | Class Name | |-------------------|--------------------------------| | checkbox | SubFormFieldsPerDocumentCheckbox | | checkbox-merge | SubFormFieldsPerDocumentCheckboxMerge | | date_signed | SubFormFieldsPerDocumentDateSigned | | dropdown | SubFormFieldsPerDocumentDropdown | | hyperlink | SubFormFieldsPerDocumentHyperlink | | initials | SubFormFieldsPerDocumentInitials | | radio | SubFormFieldsPerDocumentRadio | | signature | SubFormFieldsPerDocumentSignature | | text | SubFormFieldsPerDocumentText | | text-merge | SubFormFieldsPerDocumentTextMerge | ``` -------------------------------- ### POST /api_app Source: https://developers.hellosign.com/api/reference/operation/apiAppCreate Creates a new API App with specified configurations, including name, domains, and optional OAuth or white-labeling settings. ```APIDOC ## Create API App ### Description Creates a new API App. Requires authentication with an API key or OAuth2. ### Method POST ### Endpoint `/api_app` ### Parameters #### Request Body - **name** (string) - Required - The name you want to assign to the ApiApp. - **domains** (array of strings) - Required - The domain names the ApiApp will be associated with. Must contain 1 to 10 items. - **callback_url** (string) - Optional - The URL at which the ApiApp should receive event callbacks. - **custom_logo_file** (string) - Optional - A binary file to use as a custom logo in embedded contexts. - **oauth** (object) - Optional - OAuth related parameters. - **callback_url** (string) - Required - The OAuth callback URL. - **scopes** (array of strings) - Required - The OAuth scopes to request. - **options** (object) - Optional - Additional options supported by API App. - **white_labeling_options** (object) - Optional - Customizes the app's signer page. - **primary_button_color** (string) - Optional - The primary button color. - **primary_button_text_color** (string) - Optional - The primary button text color. ### Request Example ```json { "name": "My Production App", "domains": ["example.com"], "callback_url": "https://example.com/callback", "oauth": { "callback_url": "https://example.com/oauth", "scopes": ["basic_account_info", "request_signature"] }, "white_labeling_options": { "primary_button_color": "#00b3e6", "primary_button_text_color": "#ffffff" } } ``` ### Response #### Success Response (201) - **api_app** (object) - Details of the created API App. - **callback_url** (string | null) - The callback URL. - **client_id** (string) - The client ID of the API App. - **created_at** (integer) - Timestamp of creation. - **domains** (array of strings) - Associated domains. - **is_approved** (boolean) - Whether the app is approved. - **name** (string) - The name of the API App. - **oauth** (object) - OAuth configuration. - **callback_url** (string) - The OAuth callback URL. - **scopes** (array of strings) - Requested OAuth scopes. - **secret** (string) - The OAuth secret. - **owner_account** (object) - Information about the owner account. - **account_id** (string) - The account ID. - **email_address** (string) - The account's email address. - **white_labeling_options** (object) - White labeling settings. - **primary_button_color** (string) - The primary button color. - **primary_button_text_color** (string) - The primary button text color. #### Response Example ```json { "api_app": { "callback_url": null, "client_id": "0dd3b823a682527788c4e40cb7b6f7e9", "created_at": 1436232339, "domains": [ "example.com" ], "is_approved": false, "name": "My Production App", "oauth": { "callback_url": "https://example.com/oauth", "scopes": [ "basic_account_info", "request_signature" ], "secret": "98891a1b59f312d04cd88e4e0c498d75" }, "owner_account": { "account_id": "dc5deeb9e10b044c591ef2475aafad1d1d3bd888", "email_address": "john@example.com" }, "white_labeling_options": { "primary_button_color": "#00b3e6", "primary_button_text_color": "#ffffff" } } } ``` #### Error Response (4XX) - **error** (object) - Details about the error. - **error_name** (string) - The name of the error. - **error_msg** (string) - A message describing the error. ``` -------------------------------- ### Get Embedded Sign URL with Dropbox Sign SDK Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Obtains an embedded signing URL for a signature request. This example shows how to initialize the client and generate the URL using the signature ID. It requires an API key and the signature ID. ```python hs_client.get_embedded_object("50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b") ``` ```python from pprint import pprint from dropbox_sign import \ ApiClient, ApiException, Configuration, apis, models configuration = Configuration( username="YOUR_API_KEY", ) with ApiClient(configuration) as api_client: embedded_api = apis.EmbeddedApi(api_client) signature_id = "50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b" try: response = embedded_api.embedded_sign_url(signature_id) pprint(response) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` -------------------------------- ### Create API App using Models (JavaScript) Source: https://developers.hellosign.com/docs/sdks/node/migration-guide Demonstrates creating an API app using the new Dropbox Sign SDK with JavaScript. It shows how to instantiate the ApiAppApi, set the API key, define OAuth and white-labeling options, and assemble these into a data object for the `apiAppCreate` method. Errors are caught and logged. ```javascript import * as DropboxSign from "@dropbox/sign"; const fs = require('fs'); const apiAppApi = new DropboxSign.ApiAppApi(); apiAppApi.username = "YOUR_API_KEY"; const oauth = { callbackUrl: "https://example.com/oauth", scopes: [ "basic_account_info", "request_signature" ] }; const whiteLabelingOptions = { primaryButtonColor: "#00b3e6", primaryButtonTextColor: "#ffffff" }; const data = { name: "My Production App", domains: ["example.com"], customLogoFile: fs.createReadStream("CustomLogoFile.png"), oauth, whiteLabelingOptions }; const result = apiAppApi.apiAppCreate(data); result.then(response => { console.log(response.body); }).catch(error => { console.log("Exception when calling Dropbox Sign API:"); console.log(error.body); }); ``` -------------------------------- ### Get Bulk Send Job with Dropbox Sign SDK Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Retrieves details of a bulk send job using its ID. This example demonstrates how to initialize the client and fetch the job status. It requires an API key and the bulk send job ID. ```python from pprint import pprint from dropbox_sign import \ ApiClient, ApiException, Configuration, apis, models configuration = Configuration( username="YOUR_API_KEY", ) with ApiClient(configuration) as api_client: bulk_job_api = apis.BulkSendJobApi(api_client) bulk_send_job_id = "6e683bc0369ba3d5b6f43c2c22a8031dbf6bd174" try: response = bulk_job_api.bulk_send_job_get(bulk_send_job_id) pprint(response) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` -------------------------------- ### Build Node SDK from Source Source: https://developers.hellosign.com/docs/sdks/node/migration-guide Builds the Dropbox Sign Node.js SDK from its source code. This involves cloning the repository, packing it, and linking it in your project's package.json. ```bash git clone https://github.com/hellosign/dropbox-sign-node.git cd dropbox-sign-node npm pack # Move generated .tgz file to your project # Update package.json dependencies: # "@dropbox/sign": "file:dropbox-sign-1.0.0.tgz" npm install ``` -------------------------------- ### Get API App Info with Dropbox Sign SDK Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Retrieves information about a specific API application using its client ID. This example shows how to initialize the client and make the API call. It requires an API key and the application's client ID. ```python hs_client = HSClient(api_key="api_key") hs_client.get_api_app_info( client_id="client_id" ) ``` ```python from pprint import pprint from dropbox_sign import \ ApiClient, ApiException, Configuration, apis, models configuration = Configuration( username="YOUR_API_KEY", ) with ApiClient(configuration) as api_client: api_app_api = apis.ApiAppApi(api_client) client_id = "0dd3b823a682527788c4e40cb7b6f7e9" try: response = api_app_api.api_app_get(client_id) pprint(response) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` -------------------------------- ### Initializing ApiClient with Configuration: New Python SDK Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Shows how to initialize the 'ApiClient' in the new 'dropbox-sign' SDK using a 'Configuration' object. This client is then used to access various API endpoint classes. ```python configuration = Configuration(username="YOUR_API_KEY") with ApiClient(configuration) as api_client: account_api = apis.AccountApi(api_client) ``` -------------------------------- ### Install New Ruby SDK (gem install) Source: https://developers.hellosign.com/docs/sdks/ruby/migration-guide Installs the latest version of the dropbox-sign Ruby SDK gem. This command should be run in your terminal to add the SDK to your system. ```ruby gem install dropbox-sign ``` -------------------------------- ### Initialize HelloSignClient with API Key (Legacy SDK) Source: https://developers.hellosign.com/docs/sdks/java/migration-guide This code snippet shows how to initialize the HelloSignClient from the legacy Java SDK using an API key. This method is for older versions of the SDK and is no longer the recommended approach. ```java HelloSignClient client = new HelloSignClient(apiKey); ``` -------------------------------- ### Download Template Files (New SDK) Source: https://developers.hellosign.com/docs/sdks/python/migration-guide This Python example utilizes the new Dropbox Sign SDK to download template files as a PDF. It includes API key configuration and error handling for API calls. ```python from pprint import pprint from dropbox_sign import \ ApiClient, ApiException, Configuration, apis configuration = Configuration( username="YOUR_API_KEY", ) with ApiClient(configuration) as api_client: template_api = apis.TemplateApi(api_client) template_id = "5de8179668f2033afac48da1868d0093bf133266" try: response = template_api.template_files(template_id, file_type="pdf") open("file_response.pdf", "wb").write(response.read()) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` -------------------------------- ### Get Account Information with Dropbox Sign SDK Source: https://developers.hellosign.com/docs/sdks/php/migration-guide Retrieves account details using the Dropbox Sign PHP SDK. It requires an API key and outputs account-specific information like account ID and email address. Both legacy and new SDK examples are provided, with error handling included for the new SDK. ```php getAccount(); print_r($account->toArray()); ?> ``` ```php setUsername("YOUR_API_KEY"); // Create an Account object $account = new Dropbox\Sign\Api\AccountApi($config); try { // Send the request to Dropbox Sign $result = $account->accountGet(); // Store the account response object $accountObj = $result->getAccount(); // Retrieve the account ID from the account object $accountId = $accountObj->getAccountId(); // Retrieve the account's email address from the account object $accountEmailAddress = $accountObj->getEmailAddress(); print_r($accountObj); print_r("\n Account ID: {$accountId} \n Account Email Address: {$accountEmailAddress} "); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); echo "Exception when calling Dropbox Sign API: " . print_r($error->getError()); } ?> ``` -------------------------------- ### Creating an API App Source: https://developers.hellosign.com/docs/sdks/node/migration-guide This example demonstrates how to create a new API App using the `ApiAppApi` class. It shows how to pass parameters, including nested objects for OAuth and white-labeling options, to the API endpoint. ```APIDOC ## POST /api_app ### Description Creates a new API App with specified details, including name, domains, custom logo, OAuth configuration, and white-labeling options. ### Method POST ### Endpoint /api_app ### Parameters #### Request Body - **name** (string) - Required - The name of the API App. - **domains** (array of strings) - Required - A list of domains associated with the API App. - **customLogoFile** (File) - Optional - A custom logo file for the API App. - **oauth** (object) - Optional - Configuration for OAuth. - **callbackUrl** (string) - Required - The callback URL for OAuth. - **scopes** (array of strings) - Required - The scopes granted to the OAuth application. - **whiteLabelingOptions** (object) - Optional - Options for white-labeling the API App. - **primaryButtonColor** (string) - Optional - The color of the primary button. - **primaryButtonTextColor** (string) - Optional - The text color of the primary button. ### Request Example ```javascript import * as DropboxSign from "@dropbox/sign"; const fs = require('fs'); const apiAppApi = new DropboxSign.ApiAppApi(); apiAppApi.username = "YOUR_API_KEY"; const oauth = { callbackUrl: "https://example.com/oauth", scopes: [ "basic_account_info", "request_signature" ] }; const whiteLabelingOptions = { primaryButtonColor: "#00b3e6", primaryButtonTextColor: "#ffffff" }; const data = { name: "My Production App", domains: ["example.com"], customLogoFile: fs.createReadStream("CustomLogoFile.png"), oauth, whiteLabelingOptions }; const result = apiAppApi.apiAppCreate(data); result.then(response => { console.log(response.body); }).catch(error => { console.log("Exception when calling Dropbox Sign API:"); console.log(error.body); }); ``` ### Response #### Success Response (200) - **app** (object) - Details of the created API App. #### Response Example ```json { "app": { "app_id": "12345", "name": "My Production App", "domains": ["example.com"], "created_at": 1678886400, "updated_at": 1678886400 } } ``` ``` -------------------------------- ### Get Fax Line - Ruby Source: https://developers.hellosign.com/api/reference/operation/faxLineGet Ruby example for fetching fax line details. This requires the Dropbox Sign Ruby gem and your API key for authentication. ```ruby require 'dropbox_sign' # Set your API key client = DropboxSign::ApiClient.new(api_key: 'YOUR_API_KEY') fax_number = "[FAX_NUMBER]" begin # Retrieve fax line properties response = client.fax_line_get(fax_number) puts "Fax Line Number: #{response.fax_line.number}" puts "Created At: #{response.fax_line.created_at}" # ... process other details rescue DropboxSign::ApiException => e puts "Error retrieving fax line: #{e.message}" end ``` -------------------------------- ### Instantiate Objects Using Constructor with Array (PHP) Source: https://developers.hellosign.com/docs/sdks/php/migration-guide Demonstrates how to instantiate SDK model objects by passing an array of data directly to the constructor. This is a concise way to initialize objects with multiple properties. Ensure the SDK is included. ```PHP $signer1 = new Dropbox\Sign\Model\SubSignatureRequestSigner([ "email_address" => "jack@example.com", "name" => "Jack", "order" => 0, ]); $attachment1 = new Dropbox\Sign\Model\SubAttachment([ "name" => "Attachment 1", "instructions" => "Please download this file", "signer_index" => 0, "required" => true, ]); ``` -------------------------------- ### Overview Source: https://developers.hellosign.com/api/reference/welcome Welcome to the Dropbox Sign API reference documentation! This resource provides information and examples for the endpoints and features available in the Dropbox Sign API. The API enables you to build a variety of eSignature tools, including sending files for signing via email or embedding signature functionality directly within your application. ```APIDOC ## Overview ### Description Welcome to the Dropbox Sign API reference documentation! Here you'll find information and examples about the endpoints and features in the Dropbox Sign API. The Dropbox Sign API allows you to build with a wide range of eSignature tools, such as sending a file to be signed over email or embedding signatures directly in your app. ### Helpful Links - **Download OpenAPI Spec**: Download - **Go to source files** - **Contact support** - **Send us feedback** ### Contribution These API reference docs are newly launched. We've put lots of effort into improving content and completeness to support this launch, but the Dropbox Sign API is a broad surface and you might find areas that need more love. Please consider contributing! ### Next Steps - **Authentication** ``` -------------------------------- ### Get Fax Line - PHP Source: https://developers.hellosign.com/api/reference/operation/faxLineGet Example of retrieving fax line details using PHP. This code requires the Dropbox Sign PHP SDK and your API key. ```php getMessage(); } ?> ``` -------------------------------- ### Create Signature Request (TypeScript Example) Source: https://developers.hellosign.com/api/reference/operation/signatureRequestBulkSendWithTemplate TypeScript example for creating a Signature Request using the Dropbox Sign TypeScript SDK. This code snippet shows the setup and call for the signature request creation endpoint. ```typescript import { ApiClient, ApiException, SignatureRequestApi, SubFieldRequestSub, SubSigner, SubSignerList, SubCC } from "dropbox-sign-sdk"; const apiClient = new ApiClient("YOUR_API_KEY"); const signatureRequestApi = new SignatureRequestApi(apiClient); const data = new SubFieldRequestSub(); data.name = "company"; data.value = "ABC Corp"; const data2 = new SubFieldRequestSub(); data2.name = "company"; data2.value = "123 LLC"; const documentSignerList = new SubSignerList({ signers: [ new SubSigner({ role: "Client", name: "George", emailAddress: "george@example.com", pin: "d79a3td" }) ], customFields: [data] }); const documentSignerList2 = new SubSignerList({ signers: [ new SubSigner({ role: "Client", name: "Mary", emailAddress: "mary@example.com", pin: "gd9as5b" }) ], customFields: [data2] }); const ccs = new SubCC({ role: "Accounting", emailAddress: "accounting@example.com" }); async function createSignatureRequest() { try { const result = await signatureRequestApi.signatureRequestCreateEmbeddedDraft({ testMode: true, clientId: "YOUR_CLIENT_ID", templateIds: ["c26b8a16784a872da37ea946b9ddec7c1e11dff6"], subject: "Purchase Order", message: "Glad we could come to an agreement.", signerList: [documentSignerList, documentSignerList2], ccs: [ccs] }); console.log(result); } catch (e: any) { if (e instanceof ApiException) { console.error("Exception when calling API: ", e.response.text); } console.error(e); } } createSignatureRequest(); ``` -------------------------------- ### List Templates Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Retrieves a list of all templates available in the account. Supports pagination. ```APIDOC ## GET /template/list ### Description Retrieves a list of all templates available in the account. Supports pagination. ### Method GET ### Endpoint /template/list ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **page_size** (integer) - Optional - The number of templates to return per page. - **account_id** (string) - Optional - The ID of the account to list templates for. #### Request Body None ### Request Example ```python # Legacy SDK hs_client.get_template_list(page=1) # New SDK from dropbox_sign import ApiClient, Configuration, apis configuration = Configuration(username="YOUR_API_KEY") with ApiClient(configuration) as api_client: template_api = apis.TemplateApi(api_client) response = template_api.template_list(page=1) ``` ### Response #### Success Response (200) - **templates** (array) - A list of template objects. - **page** (integer) - The current page number. - **page_size** (integer) - The number of templates per page. - **num_pages** (integer) - The total number of pages available. #### Response Example ```json { "templates": [ { "template_id": "template_id_1", "title": "Template One" }, { "template_id": "template_id_2", "title": "Template Two" } ], "page": 1, "page_size": 20, "num_pages": 5 } ``` ``` -------------------------------- ### Get Account Information Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Retrieves information about the authenticated account. ```APIDOC ## GET /account ### Description Retrieves information about the authenticated account. ### Method GET ### Endpoint /account ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```python # Using legacy SDK hs_client = HSClient(api_key="your_api_key") account = hs_client.get_account_info() print hs_client.account.email_address ``` ```python # Using new SDK from pprint import pprint from dropbox_sign import \ ApiClient, ApiException, Configuration, apis configuration = Configuration( username="YOUR_API_KEY", ) with ApiClient(configuration) as api_client: account_api = apis.AccountApi(api_client) try: response = account_api.account_get() pprint(response) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` ### Response #### Success Response (200) - **email_address** (string) - The email address of the account. #### Response Example ```json { "email_address": "example@example.com", "is_locked": false, "is_paid_hs": true, "type": "standard", "user_id": "a1b2c3d4e5f678901234567890abcdef" } ``` ``` -------------------------------- ### Create API App Source: https://developers.hellosign.com/api/reference/api-app Creates a new API App for your account. ```APIDOC ## POST /api_app ### Description Creates a new API App. This app can then be used for embedded workflows or OAuth integrations. ### Method POST ### Endpoint `/api_app` ### Parameters #### Request Body - **app_name** (string) - Required - The desired name for the new API App. ### Request Example ```json { "app_name": "My New Integration App" } ``` ### Response #### Success Response (201) - **client_id** (string) - The unique identifier for the newly created API App. - **app_name** (string) - The name of the created API App. - **owner_account** (object) - Information about the account that owns the API App. #### Response Example ```json { "client_id": "NEW_CLIENT_ID", "app_name": "My New Integration App", "owner_account": { "account_id": "12345", "display_name": "Example Team" } } ``` ``` -------------------------------- ### Get Signature Request Status (cURL) Source: https://developers.hellosign.com/api/reference/operation/signatureRequestGet Example cURL command to retrieve the status of a signature request. Requires your API key for authentication and the signature request ID as a path parameter. ```cURL curl -X GET 'https://api.hellosign.com/v3/signature_request/{signature_request_id}' \ -u 'YOUR_API_KEY:' ``` -------------------------------- ### Listing Signature Requests (New SDK) Source: https://developers.hellosign.com/docs/sdks/node/migration-guide This example demonstrates listing signature requests with the new SDK, where path and query parameters are passed as separate arguments. ```APIDOC ## GET /signature_request ### Description Lists signature requests using the new SDK. Path and query parameters are passed as individual arguments. ### Method GET ### Endpoint /signature_request ### Parameters #### Query Parameters - **accountId** (string) - Optional - The ID of the account to filter requests. - **page** (integer) - Optional - The page number for pagination. ### Request Example ```javascript import * as DropboxSign from "@dropbox/sign"; const signatureApi = new DropboxSign.SignatureRequestApi(); signatureApi.username = "YOUR_API_KEY"; const accountId = null; const page = 1; const result = signatureApi.signatureRequestList(accountId, page); result.then(response => { console.log(response.body); }).catch(error => { console.log("Exception when calling Dropbox Sign API:"); console.log(error.body); }); ``` ### Response #### Success Response (200) - **signature_requests** (array) - A list of signature requests. #### Response Example ```json { "signature_requests": [ { "signature_request_id": "123", "title": "Document for Signature" } ] } ``` ``` -------------------------------- ### Upload Files using Legacy SDK (Java) Source: https://developers.hellosign.com/docs/sdks/java/migration-guide Demonstrates how to upload files using the legacy `hellosign-java-sdk` (version 5.2.3 and earlier) by utilizing the `Document` class and its `setFile` method. ```java //Using the Document Class Document doc1 = new Document(); doc1.setFile(new File("/NDA.pdf")); ``` -------------------------------- ### Get Account Information Source: https://developers.hellosign.com/docs/sdks/ruby/migration-guide Retrieves information about the authenticated API account. ```APIDOC ## GET /account ### Description Retrieves information about the authenticated API account. ### Method GET ### Endpoint `/account` ### Parameters None ### Response #### Success Response (200) - **account** (object) - Contains the details of the account. ### Response Example ```json { "account": { "account_id": "a1b2c3d4e5f678901234567890abcdef", "email_address": "user@example.com", "first_name": "John", "last_name": "Doe", "is_locked": false } } ``` ``` -------------------------------- ### Get Fax API Source: https://developers.hellosign.com/docs/fax/v3migration Retrieves information about a specific fax. ```APIDOC ## GET /v3/fax ### Description Retrieves information about a specific fax. ### Method GET ### Endpoint /v3/fax ### Parameters #### Path Parameters None #### Query Parameters - **fax_id (string)** - Required - The ID of the fax to retrieve. ### Request Example ```json { "fax_id": "9c2c7e8c2ed1839f75a9a0227ce2954b1d7c3407" } ``` ### Response #### Success Response (200) - **transmission (object)** - Details about the fax transmission. - **event (object)** - Details about the fax event. #### Response Example ```json { "transmission": { "test_mode": false, "signature_request_id": "", "title": "Example Title", "original_title": "Example Title", "message": "Please read", "metadata": {}, "created_at": 1738001529, "is_complete": false, "is_declined": false, "has_error": false, "files_url": "https://api.hellosign.com/apiapp_dev.php/v3/fax/files/9c2c7e8c2ed1839f75a9a0227ce2954b1d7c3407", "cc_email_addresses": [], "final_copy_uri": "/v3/transmission/final_copy/9c2c7e8c2ed1839f75a9a0227ce2954b1d7c3407", "template_ids": [], "custom_fields": [], "attachments": [], "response_data": [], "signatures": [] }, "event": { "event_time": "1738001529", "event_type": "fax_sent", "event_hash": "950d3bdf03a30d520dfa6ac51a952ff93fe3a4d9754dd1412b6aec36206c1e81", "event_metadata": { "reported_for_account_id": "63522885f9261e2b04eea043933ee7313eb674fd" } } } ``` ``` -------------------------------- ### Importing SDK Components: Legacy vs. New Python SDK Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Demonstrates the difference in importing SDK components between the legacy 'hellosign-python-sdk' and the new 'dropbox-sign' SDK. The new SDK requires importing individual classes for different functionalities. ```python from hellosign_sdk import HSClient ``` ```python from dropbox_sign import \ ApiClient, ApiException, Configuration, apis, models ``` -------------------------------- ### Get Account Details via cURL Source: https://developers.hellosign.com/api/reference/operation/accountGet Example of retrieving account details using a cURL request. This method requires your API key for authentication. The request can filter by email address or account ID. ```cURL curl -X GET 'https://api.hellosign.com/v3/account?email_address=jack@example.com' \ -u 'YOUR_API_KEY:' ``` -------------------------------- ### Instantiate Dropbox Sign SDK Objects (Python) Source: https://developers.hellosign.com/docs/sdks/python/migration-guide Demonstrates two methods for creating objects in the Dropbox Sign SDK using Python: direct instantiation with constructor arguments and using the static `init()` method with a dictionary. Both methods achieve the same result for creating signer and attachment objects. Requires the 'dropbox_sign' library. ```python signer_1 = models.SubSignatureRequestSigner( email_address="jack@example.com", name="Jack", order=0, ) attachment_1 = models.SubAttachment( name="Attachment 1", instructions="Please download this file", signer_index=0, required=True ) ``` ```python signer_1 = models.SubSignatureRequestSigner.init({ "email_address": "jack@example.com", "name": "Jack", "order": 0, }) attachment_1 = models.SubAttachment.init({ "name": "Attachment 1", "instructions": "Please download this file", "signer_index": 0, "required": True }) ``` -------------------------------- ### Process API Warnings with Loop (Java) Source: https://developers.hellosign.com/docs/sdks/java/migration-guide Shows how to process warnings returned by the new HelloSign SDK. It demonstrates iterating through a list of WarningResponse objects and printing their names and messages. ```java import com.dropbox.sign.ApiException; import com.dropbox.sign.Configuration; import com.dropbox.sign.api.*; import com.dropbox.sign.auth.*; import com.dropbox.sign.model.*; import java.util.Objects; public class Example { public static void main(String[] args) { var apiClient = Configuration.getDefaultApiClient() .setApiKey("YOUR_API_KEY"); var accountApi = new AccountApi(apiClient); var data = new AccountCreateRequest() .emailAddress("newuser@dropboxsign.com"); try { AccountCreateResponse result = accountApi.accountCreate(data); System.out.println(result); // warning loop Objects.requireNonNull(result.getWarnings()).forEach(warning -> { System.err.println("Warning Name: " + warning.getWarningName()); System.err.println("Warning Message: " + warning.getWarningMsg()); }); } catch (ApiException e) { System.err.println("Exception when calling AccountApi#accountCreate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` -------------------------------- ### Install Dropbox Sign PHP SDK using Composer Source: https://developers.hellosign.com/docs/sdks/php/migration-guide This command installs the new Dropbox Sign PHP SDK package from Packagist using Composer. It's the recommended method for adding the SDK to your project. ```bash composer require dropbox/sign ``` -------------------------------- ### Download Template as File URL (New SDK) Source: https://developers.hellosign.com/docs/sdks/python/migration-guide This code example shows how to obtain a file URL for a template using the new Dropbox Sign SDK. It includes API key configuration and handles potential API exceptions. ```python from pprint import pprint from dropbox_sign import \ ApiClient, ApiException, Configuration, apis configuration = Configuration( username="YOUR_API_KEY", ) with ApiClient(configuration) as api_client: template_api = apis.TemplateApi(api_client) template_id = "5de8179668f2033afac48da1868d0093bf133266" try: response = template_api.template_files_as_file_url(template_id) pprint(response) except ApiException as e: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` -------------------------------- ### Download Signature Request Files (New PHP SDK) Source: https://developers.hellosign.com/docs/sdks/php/migration-guide This snippet illustrates how to download signature request files using the new Dropbox Sign PHP SDK. It covers retrieving the signature request object to get its title and then downloading the files. The example shows how to save the downloaded file locally, with specific instructions for handling ZIP files. Error handling for API exceptions is also included. ```php setUsername("YOUR_API_KEY"); // Create a Signature Request object $signatureRequest = new Dropbox\Sign\Api\SignatureRequestApi($config); $signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; try { // Create a Signature Request object containing the data for the signature request (optional) $sigReqObj = $signatureRequest->signatureRequestGet($signatureRequestId); // Save the title for later use to save file (optional) $title = $sigReqObj->getSignatureRequest() ->getTitle(); // Send the request to Dropbox Sign $result = $signatureRequest->signatureRequestFiles($signatureRequestId); // For a ZIP file: // $result = $signatureRequest->signatureRequestFiles($signatureRequestId, "zip"); // Save the file copy($result->getRealPath(), __DIR__ . '/file_response.pdf'); // For a ZIP file: // copy($result->getRealPath(), __DIR__ . '/file_response.zip'); } catch (Dropbox\Sign\ApiException $e) { $error = $e->getResponseObject(); echo "Exception when calling Dropbox Sign API: " . print_r($error->getError()); } ``` -------------------------------- ### Instantiate Objects Using Setter Methods (Ruby) Source: https://developers.hellosign.com/docs/sdks/ruby/migration-guide This code example shows how to instantiate objects first and then set their properties individually using setter methods. This approach provides more explicit control over each attribute and can be useful for complex object initializations in Ruby. ```Ruby signer_1 = Dropbox::Sign::SubSignatureRequestSigner.new signer_1.email_address = "jack@dropboxsign.com" signer_1.name = "Jack" signer_1.order = 0 attachment1 = Dropbox::Sign::SubAttachment.new attachment1.name = "Attachment 1" attachment1.instructions = "Please download this file" attachment1.signer_index = 0 attachment1.required = true ```