Version: 2.0
Base URL: https://app.datapublisher.io/api
Development URL: http://localhost:3001/api
New to Data Publisher? Begin with our Complete Guide to understand:
The Data Publisher API provides comprehensive document automation, email campaign management, and data integration capabilities. This RESTful API uses JWT authentication and supports various data sources including CSV files, Google Sheets, Microsoft Excel, and SQL Server.
The API uses JWT (JSON Web Token) authentication with registration codes for user signup.
⚠️ Note: API keys for third-party developers are not yet implemented. Current authentication is designed for the Word add-in client.
Authorization: Bearer
See Authentication Guide for details.
// 1. Register/Login
const response = await fetch('http://localhost:3001/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
username: 'youruser',
password: 'yourpass'
})
});
const { token } = await response.json();
// 2. Upload data file
const uploadResponse = await fetch('http://localhost:3001/api/data', {
method: 'POST',
headers: {
'Authorization': Bearer ${token},
'Content-Type': 'application/json'
},
body: JSON.stringify({
fileName: 'customers.csv',
fileType: 'csv',
fileContent: 'Name,Email\\nJohn,john@example.com'
})
});
// 3. Create email campaign
const campaignResponse = await fetch('http://localhost:3001/api/email-campaigns', {
method: 'POST',
headers: {
'Authorization': Bearer ${token},
'Content-Type': 'application/json'
},
body: JSON.stringify({
campaignName: 'Welcome Campaign',
dataFileId: uploadResponse.id,
emailField: 'Email',
defaultSubject: 'Welcome!',
// ... more campaign config
})
});
{
"success": true,
"data": { },
"message": "Operation completed successfully"
}
{
"success": false,
"error": "Error message",
"details": { }
}
200 OK - Success
201 Created - Resource created
400 Bad Request - Invalid request
401 Unauthorized - Missing or invalid token
403 Forbidden - Insufficient permissions
404 Not Found - Resource not found
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Server error