Dropbox Sign Python SDK
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
- breaking The package name and entire module structure changed from `hellosign-sdk` to `dropbox-sign`. This is not a simple upgrade.
- gotcha API Key vs. OAuth2 for authentication: Ensure you use the correct configuration method for your chosen authentication flow.
- gotcha API errors are raised as `ApiException`. Catching generic `Exception` might mask specific API response issues.
Install
-
pip install dropbox-sign
Imports
- Configuration
from dropbox_sign import Configuration
- ApiClient
from dropbox_sign import ApiClient
- account_api
from dropbox_sign.apis import account_api
- ApiException
from dropbox_sign.exceptions import ApiException
Quickstart
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}")