SDKs
DocumentFlow provides official SDKs for several popular programming languages to make integration easier. These SDKs handle authentication, request construction, and response parsing for you.
Available SDKs
- JavaScript (Node.js)
- Python
- Ruby
- PHP
- Java
- Go
Installation
npm install documentflow
Usage Example
Here's a quick example of how to use the DocumentFlow SDK in JavaScript:
import DocumentFlow from 'documentflow';
const client = new DocumentFlow('YOUR_API_KEY');
async function processDocument() {
try {
const document = await client.documents.process({
url: 'https://example.com/invoice.pdf',
type: 'invoice'
});
console.log('Document ID:', document.id);
console.log('Status:', document.status);
// Wait for processing to complete
const result = await client.documents.waitForResult(document.id);
console.log('Processing complete:', result);
} catch (error) {
console.error('Error:', error.message);
}
}
processDocument();
For more detailed information and examples for each SDK, please refer to the specific SDK documentation.