
Docs
Version 1.0.0
DataWise Document Exchange
API v1.0.0
E-Signature Document Delivery
User API Request
↓
DDX generates document
↓
DDX sends to e-signature service
↓
E-Sign Service → Webhook: "Sent" event
├→ DDX updates job status: "documentSent"
└→ DDX charges customer ($0.01 base + $0.10 e-sign)
↓
Signer signs document
↓
E-Sign Service → Webhook: "Completed" event
├→ DDX updates job status: "documentSent & Signed"
├→ DDX downloads signed PDF
└→ DDX forwards to your webhook URL| Event Type | Description | DDX Action |
|---|---|---|
| Sent | Document successfully sent to signers | Update job status to documentSent, charge customer |
| SendFailed | Failed to send document to signers | Update job status to Failed, log error |
| DeliveryFailed | Email delivery failed | Log failure (no job update) |
| Completed | All signers have signed the document | Download PDF, forward to your webhook, update status |
For publicly accessible endpoints that don't require authentication:
formData.append('ddxE_webhookUrl', 'https://yourapp.com/api/signed-docs');Request to your webhook:
POST https://yourapp.com/api/signed-docs Content-Type: application/pdf [Binary PDF data]
interface EncryptedPayload {
url: string; // Required: Webhook URL
params?: Record<string, any>; // Optional: Query parameters
headers?: Record<string, any>; // Optional: HTTP headers
responseType?: 'base64'; // Optional: Response format (omit for stream)
metadata?: Record<string, any>; // Optional: Custom data (only for base64)
}Get Your Encryption Public Key
DDX_PUBLIC_KEY. Best for: Proxying PDFs, large files, memory efficiency
{
url: 'https://yourapp.com/webhook',
headers: { 'Authorization': 'Bearer token' }
}• Content-Type: application/pdf
• Body: Raw binary PDF stream
• Memory: Low (~64KB chunks)
Best for: JSON APIs, storing in databases, embedding in payloads
{
url: 'https://yourapp.com/webhook',
headers: { 'Authorization': 'Bearer token' },
responseType: 'base64',
metadata: { orderId: 123, userId: 456 }
}• Content-Type: application/json
• Body: JSON object with base64-encoded PDF
• Memory: High (~130% of original file size)
JSON Response Structure:
The webhook receives a JSON object containing:
ddx_file property with base64-encoded PDF {
"orderId": 123,
"userId": 456,
"ddx_file": "JVBERi0xLjQK..."
}// JavaScript - Access metadata and decode PDF
const { orderId, userId, ddx_file } = req.body;
const pdfBuffer = Buffer.from(ddx_file, 'base64');
fs.writeFileSync(`signed_${orderId}.pdf`, pdfBuffer);
// Python - Access metadata and decode PDF
order_id = request.json['orderId']
user_id = request.json['userId']
pdf_base64 = request.json['ddx_file']
pdf_bytes = base64.b64decode(pdf_base64)
with open(f'signed_{order_id}.pdf', 'wb') as f:
f.write(pdf_bytes)DDX automatically retries webhook deliveries with exponential backoff:
Total retries: 3 attempts over ~3 seconds
API Request:
const formData = new FormData();
formData.append('ddx_template', templateFile);
formData.append('ddx_outputFormat', 'pdf');
formData.append('ddxE_signers', JSON.stringify([
{
signerRole: 'client',
signerEmail: 'client@example.com',
signerName: 'John Doe',
required: ['signature', 'date']
}
]));
formData.append('ddxE_senderEmail', 'sender@yourcompany.com');
formData.append('ddxE_webhookUrl', 'https://yourapp.com/api/signed-docs');
const response = await fetch('https://api.datawise.app/api/datawise_document_exchange', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
body: formData
});Webhook Handler:
app.post('/api/signed-docs', async (req, res) => {
// req.body is the PDF binary stream
const pdfBuffer = await streamToBuffer(req);
fs.writeFileSync('signed-document.pdf', pdfBuffer);
res.status(200).send('Received');
});Pro Tip
© Copyright 2026, Datawise Document Exchange.