SDKs overview
PandaDoc offers Software Development Kits (SDKs) to facilitate programmatic interaction with its platform, enabling developers to integrate document automation, e-signature, and content management capabilities into their applications. These SDKs abstract the underlying RESTful API, providing language-specific interfaces for common operations such as creating documents from templates, sending documents for signature, and tracking document status. The primary goal of these libraries is to reduce the development effort required for integrating PandaDoc functionalities, allowing developers to focus on business logic rather rather than low-level HTTP requests and response parsing.
The PandaDoc API itself supports standard HTTP methods (GET, POST, PUT, DELETE) and uses JSON for request and response bodies. Authentication is typically handled via an API key, which is passed in the Authorization header (PandaDoc API documentation). The SDKs manage the complexities of authentication and request formatting, presenting a more idiomatic experience for developers working in specific programming languages. This approach aligns with common practices for API integration, as seen in other platforms like Stripe's API client libraries or AWS SDKs for various languages.
Official SDKs by language
PandaDoc provides official SDKs for several popular programming languages, designed to streamline integration with the PandaDoc API. These libraries are maintained by PandaDoc and offer comprehensive coverage of the API's features.
| Language | Package Manager/Repository | Installation Command | Maturity |
|---|---|---|---|
| Python | PyPI | pip install pandadoc-python-client |
Stable |
| Node.js | npm | npm install pandadoc-node-client |
Stable |
| Ruby | RubyGems | gem install pandadoc-ruby-client |
Stable |
| PHP | Composer | composer require pandadoc/php-client |
Stable |
| .NET | NuGet | Install-Package PandaDoc.NET.Client |
Stable |
| Java | Maven/Gradle | Maven:Gradle: |
Stable |
Installation
To begin using the PandaDoc SDKs, you need to install the appropriate client library for your preferred programming language. The following instructions detail the common installation methods for the officially supported SDKs.
Python
The Python SDK can be installed using pip, the standard package installer for Python:
pip install pandadoc-python-client
Node.js
For Node.js projects, the SDK is available via npm (Node Package Manager):
npm install pandadoc-node-client
Ruby
Ruby applications can integrate the PandaDoc SDK using RubyGems:
gem install pandadoc-ruby-client
PHP
The PHP SDK is managed through Composer:
composer require pandadoc/php-client
.NET
For .NET development, the SDK is available as a NuGet package:
Install-Package PandaDoc.NET.Client
Java
Java projects typically use Maven or Gradle for dependency management. Below are examples for both:
Maven
Add the following dependency to your pom.xml file:
<dependency>
<groupId>com.pandadoc</groupId>
<artifactId>pandadoc-java-client</artifactId>
<version>[LATEST_VERSION]</version>
</dependency>
Gradle
Add this line to your build.gradle file under dependencies:
implementation 'com.pandadoc:pandadoc-java-client:[LATEST_VERSION]'
Replace [LATEST_VERSION] with the current version number found in the PandaDoc API documentation or Maven Central.
Quickstart example
This quickstart example demonstrates how to create a document from a template using the PandaDoc Python SDK. This process involves authenticating with your API key, specifying a template, defining recipients, and sending the document. A similar workflow applies across other SDKs, with language-specific syntax.
Python Quickstart: Create and Send a Document
Before running this code, ensure you have your PandaDoc API key. You can find your API key in your PandaDoc developer settings.
import pandadoc_client
from pandadoc_client.rest import ApiException
# Configure API key authorization:
configuration = pandadoc_client.Configuration(host="https://api.pandadoc.com")
configuration.api_key['Authorization'] = 'YOUR_PANDADOC_API_KEY'
configuration.api_key_prefix['Authorization'] = 'API-Key'
# Create an instance of the API client
api_client = pandadoc_client.ApiClient(configuration)
# Instantiate the Document API
document_api = pandadoc_client.DocumentsApi(api_client)
# --- Step 1: Define Document Details ---
# Replace with your actual template UUID from PandaDoc
template_uuid = 'YOUR_TEMPLATE_UUID'
# Define recipients for the document
recipients = [
pandadoc_client.DocumentCreateRequestRecipients(
email='[email protected]',
first_name='John',
last_name='Doe',
role='client_role' # Optional, if you have roles in your template
)
]
# Define tokens to populate template fields (if applicable)
tokens = [
pandadoc_client.DocumentCreateRequestTokens(
name='Client.Name',
value='John Doe LLC'
)
]
# Define fields (form fields that can be pre-filled)
fields = {
'Favorite Color': pandadoc_client.DocumentCreateRequestFields(
value='Blue',
assignee='[email protected]'
)
}
# --- Step 2: Create the Document Object ---
document_create_request = pandadoc_client.DocumentCreateRequest(
name='Proposal for John Doe LLC',
template_uuid=template_uuid,
recipients=recipients,
tokens=tokens,
fields=fields,
metadata={'deal_id': '12345'},
tags=['proposal', 'python-sdk']
)
# --- Step 3: Create the Document ---
try:
response = document_api.create_document(document_create_request)
print(f"Document created successfully! UUID: {response.id}")
# --- Step 4: Send the Document (optional, but common) ---
document_send_request = pandadoc_client.DocumentSendRequest(
message='Please review and sign this proposal.',
subject='Your PandaDoc Proposal',
silent=False # Set to True to send without email notification
)
send_response = document_api.send_document(response.id, document_send_request)
print(f"Document sent successfully! Status: {send_response.status}")
except ApiException as e:
print(f"Error creating or sending document: {e}")
if e.body:
print(f"Response body: {e.body}")
This example initiates the creation of a document based on a specified template, assigns a recipient, populates custom data using tokens and fields, and then sends the document. The ApiException class helps in catching and handling errors returned by the PandaDoc API.
Community libraries
While PandaDoc provides a set of official SDKs, the open-source community may also develop and maintain additional client libraries or integrations. These community-contributed projects can offer support for languages not officially covered, alternative architectural patterns, or specialized functionalities. Developers often share such projects on platforms like GitHub or through language-specific package repositories.
When considering community libraries, it is important to evaluate their maintenance status, documentation, and compatibility with the latest PandaDoc API versions. Community contributions can be valuable for niche use cases or specific technology stacks where an official SDK is not available. However, they may not come with the same level of support or guarantees as official offerings. It is recommended to check relevant GitHub repositories or developer forums for the most up-to-date information on community-driven PandaDoc integrations.
As of the last update, the primary development effort is focused on the official SDKs due to their comprehensive coverage and direct support from PandaDoc. Developers seeking to extend functionality or integrate with other ecosystems often build upon these official clients or use the raw API directly. For example, a developer might use the Google Cloud SDK in conjunction with the PandaDoc Python SDK to automate document workflows triggered by events in a Google Cloud environment.