Dropbox Sign Python SDK

1.10.0 · active · verified Sat Apr 11

The official Python SDK for interacting with the Dropbox Sign API (formerly HelloSign). It provides a programmatic interface to send signature requests, manage documents, handle templates, and more. The current version is 1.10.0, with a release cadence that generally follows API updates and bug fixes.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the Dropbox Sign client using an API key from an environment variable, fetch basic account information, and handle potential API errors. Replace `DROPBOX_SIGN_API_KEY` with your actual API key.

import os
from dropbox_sign import Configuration, ApiClient
from dropbox_sign.apis import account_api
from dropbox_sign.exceptions import ApiException

# It's recommended to load your API key from environment variables
api_key = os.environ.get('DROPBOX_SIGN_API_KEY', '')

if not api_key:
    print("Warning: DROPBOX_SIGN_API_KEY environment variable not set. "
          "This example will likely fail. Please set it for a successful run.")

# Configure API key authorization
configuration = Configuration(api_key=api_key)

try:
    # Create an API client instance
    with ApiClient(configuration) as api_client:
        # Instantiate a specific API (e.g., AccountApi) with the client
        account_api_instance = account_api.AccountApi(api_client)
        
        # Call an API method, e.g., get the current account information
        response = account_api_instance.account_get()
        
        print("Successfully retrieved account information:")
        print(response.to_dict()) # Convert response model to dictionary for easy printing
        
except ApiException as e:
    print(f"Error calling Dropbox Sign API: Status {e.status}, Reason {e.reason}, Body {e.body}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

view raw JSON →