Custom API Integration
Build custom integrations with any platform using Continuata's REST API for complete control over digital product delivery.
Common Integration Patterns
Order Processing
Generate download tokens when payments are confirmed.
- • Payment webhook → API call
- • Automatic token generation
- • Email delivery integration
Customer Portal
Build download libraries for returning customers.
- • Purchase history API
- • Download link generation
- • Usage analytics display
Basic Workflow
Here's a typical integration workflow for generating download tokens after a purchase:
Customer Completes Purchase
Your payment processor (Stripe, PayPal, etc.) confirms the transaction.
Generate Download Token
Call Continuata API to create a secure download token for the purchased products.
Deliver to Customer
Send the download link via email, add to customer account, or integrate with your platform.
API Endpoints
Generate Download Token
POST /api/products/{productId}/tokens
{
"customerEmail": "customer@example.com",
"expiresAt": "2025-02-01T00:00:00Z",
"maxDownloads": null,
"metadata": {
"orderId": "order_123",
"customerName": "John Doe"
}
}Response:
{
"success": true,
"data": {
"token": {
"id": "token_abc123",
"downloadUrl": "https://continuata.io/download?token=abc123",
"expiresAt": "2025-02-01T00:00:00Z",
"product": {
"id": "epic-drums-v1",
"name": "Epic Drum Kit Vol. 1",
"version": "1.0.0"
}
}
}
}List Customer Purchases
GET /api/purchases?customerEmail=customer@example.comGet Download Analytics
GET /api/analytics/downloads?productId=epic-drums-v1&period=30dExample: Node.js Integration
Complete example showing how to integrate Continuata with a custom Node.js application:
const express = require('express');
const axios = require('axios');
const app = express();
app.use(express.json());
// Continuata API configuration
const CONTINUATA_API_KEY = process.env.CONTINUATA_API_KEY;
const CONTINUATA_ORG_ID = process.env.CONTINUATA_ORG_ID;
const continuataClient = axios.create({
baseURL: 'https://continuata.io/api',
headers: {
'Authorization': `Bearer ${CONTINUATA_API_KEY}`,
'Content-Type': 'application/json'
}
});
// Handle successful payments
app.post('/payment-success', async (req, res) => {
const { orderId, customerEmail, customerName, items } = req.body;
try {
// Generate download tokens for each digital product
const downloadLinks = [];
for (const item of items) {
if (item.type === 'digital') {
const tokenResponse = await continuataClient.post(
`/products/${item.productId}/tokens`,
{
customerEmail,
expiresAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), // 30 days
metadata: {
orderId,
customerName,
itemName: item.name
}
}
);
downloadLinks.push({
product: item.name,
downloadUrl: tokenResponse.data.data.token.downloadUrl
});
}
}
// Send email with download links
await sendDownloadEmail(customerEmail, customerName, downloadLinks);
res.json({ success: true, downloadLinks });
} catch (error) {
console.error('Error generating download tokens:', error);
res.status(500).json({ error: 'Failed to generate download links' });
}
});
async function sendDownloadEmail(email, name, downloadLinks) {
// Your email service implementation
console.log(`Sending ${downloadLinks.length} download links to ${email}`);
}
app.listen(3000);Error Handling
Implement proper error handling for robust integrations:
try {
const response = await continuataClient.post('/products/epic-drums/tokens', tokenData);
return response.data.data.token;
} catch (error) {
if (error.response?.status === 404) {
throw new Error('Product not found - check product ID');
} else if (error.response?.status === 403) {
throw new Error('Insufficient permissions - check API key scopes');
} else if (error.response?.status === 429) {
throw new Error('Rate limited - implement exponential backoff');
} else {
throw new Error(`Continuata API error: ${error.message}`);
}
}Need Help?
Check the Authentication docs for API setup, or contact support@continuata.com for integration assistance.