Installation
Account Setup
To use DocDigitizer’s document extraction API, you need an active account with API access.
Step 1: Request Access
- Visit docdigitizer.com/contact
- Fill out the contact form indicating your interest in API access
- Our team will reach out to discuss your requirements and pricing
Step 2: Account Activation
Once your account is approved, you will receive:
- API Key – Your unique authentication key
- Context ID – A UUID identifying your processing configuration
- Access to the Developer Portal – Manage your credentials and monitor usage
Step 3: Accept Terms of Service
Review and accept the DocDigitizer API Terms of Service and Data Processing Agreement before making API calls.
Obtaining Your Credentials
You need two pieces of information to authenticate with the DocDigitizer API:
| Credential | Format | Purpose |
|---|---|---|
| API Key | Alphanumeric string | Authenticates your requests. Passed in the x-api-key header. |
| Context ID | UUID (e.g., 550e8400-e29b-41d4-a716-446655440000) |
Identifies your processing configuration, including document schemas and pipeline settings. |
Where to Find Your Credentials
Your credentials are provided during the onboarding process. If you need to retrieve them:
- Contact your DocDigitizer account manager
- Email support@docdigitizer.com with your company name
Security Best Practices
- Never expose your API key in client-side code, public repositories, or logs
- Use environment variables to store credentials in your applications
- Rotate your API key if you suspect it has been compromised
- Use separate keys for development and production environments when possible
Environment Setup
Configure your development environment to securely store and use your DocDigitizer credentials.
Using Environment Variables
Windows (Command Prompt)
set DD_API_KEY=your_api_key_here
set DD_CONTEXT_ID=your_context_id_here
Windows (PowerShell)
$env:DD_API_KEY = "your_api_key_here"
$env:DD_CONTEXT_ID = "your_context_id_here"
For permanent environment variables in PowerShell:
[System.Environment]::SetEnvironmentVariable("DD_API_KEY", "your_api_key_here", "User")
[System.Environment]::SetEnvironmentVariable("DD_CONTEXT_ID", "your_context_id_here", "User")
Linux / macOS (Bash)
export DD_API_KEY="your_api_key_here"
export DD_CONTEXT_ID="your_context_id_here"
Add these lines to your ~/.bashrc or ~/.zshrc file for persistence.
Using a .env File
Many frameworks support .env files for configuration. Create a file named .env in your project root:
DD_API_KEY=your_api_key_here
DD_CONTEXT_ID=your_context_id_here
Important: Add .env to your .gitignore file to prevent accidentally committing credentials.
SDK & Library Installation
DocDigitizer’s REST API can be accessed using standard HTTP libraries. Below are setup instructions for popular platforms.
Python
Install the requests library:
pip install requests
For handling UUIDs (included in Python standard library):
import uuid
import requests
import os
api_key = os.environ.get("DD_API_KEY")
context_id = os.environ.get("DD_CONTEXT_ID")
Node.js / JavaScript
Install required packages:
npm install node-fetch form-data uuid dotenv
Usage:
require('dotenv').config();
const fetch = require('node-fetch');
const FormData = require('form-data');
const { v4: uuidv4 } = require('uuid');
const apiKey = process.env.DD_API_KEY;
const contextId = process.env.DD_CONTEXT_ID;
C# / .NET
No additional packages required for basic HTTP calls. The HttpClient class is included in .NET.
For environment variables:
string apiKey = Environment.GetEnvironmentVariable("DD_API_KEY");
string contextId = Environment.GetEnvironmentVariable("DD_CONTEXT_ID");
Optional: Install Newtonsoft.Json for JSON handling:
dotnet add package Newtonsoft.Json
PowerShell
PowerShell includes built-in cmdlets for HTTP requests. No additional installation required.
Install our optional PowerShell module for simplified usage:
Install-Module -Name DocDigitizer -Scope CurrentUser
See the PowerShell Cmdlets documentation for detailed setup instructions.
Java
Add the Apache HttpClient dependency to your pom.xml:
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.2</version>
</dependency>
Or for Gradle:
implementation 'org.apache.httpcomponents.client5:httpclient5:5.2'
PHP
Install Guzzle HTTP client:
composer require guzzlehttp/guzzle
Or use PHP’s built-in cURL functions.
cURL (Command Line)
cURL is pre-installed on most Unix-like systems. For Windows:
- Windows 10/11 includes cURL by default
- Or download from curl.se/download.html
Verifying Your Setup
Test your installation and credentials with a simple API call.
Quick Test with cURL
Run this command to verify your credentials (replace with your actual values):
curl -X POST https://apix.docdigitizer.com/sync \
-H "x-api-key: $DD_API_KEY" \
-F "files=@test-document.pdf" \
-F "id=$(uuidgen)" \
-F "contextId=$DD_CONTEXT_ID"
Quick Test with PowerShell
$headers = @{ "x-api-key" = $env:DD_API_KEY }
$form = @{
files = Get-Item -Path "test-document.pdf"
id = [guid]::NewGuid().ToString()
contextId = $env:DD_CONTEXT_ID
}
Invoke-RestMethod -Uri "https://apix.docdigitizer.com/sync" `
-Method Post -Headers $headers -Form $form
Expected Response
A successful test returns a JSON response with extracted data:
{
"StateText": "COMPLETED",
"TraceId": "ABC1234",
"NumberPages": 1,
"Output": [ ... ]
}
Common Issues
| Error | Cause | Solution |
|---|---|---|
401 Unauthorized |
Invalid or missing API key | Verify your x-api-key header value |
400 Bad Request |
Missing required parameters | Ensure files, id, and contextId are provided |
403 Forbidden |
Invalid Context ID or insufficient permissions | Verify your Context ID is correct |
| Connection timeout | Network or firewall issue | Check your network connection and firewall settings |