Back to API Reference

Data Publisher API Documentation

Version: 2.0

Base URL: https://app.datapublisher.io/api

Development URL: http://localhost:3001/api

📘 Start Here

New to Data Publisher? Begin with our Complete Guide to understand:

Overview

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.

Key Features

Authentication

Current Implementation

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.

Getting Started

  • Register for an account with a registration code
  • Login to receive a JWT token
  • Include token in all authenticated requests: Authorization: Bearer
  • See Authentication Guide for details.

    API Categories

    Core APIs

    Email & Publishing

    Data Integration

    Advanced Features

    Quick Start Example

    // 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

    })

    });

    Rate Limits

    Response Format

    Success Response

    {
    

    "success": true,

    "data": { },

    "message": "Operation completed successfully"

    }

    Error Response

    {
    

    "success": false,

    "error": "Error message",

    "details": { }

    }

    HTTP Status Codes

    Support

    Roadmap

    Coming Soon

    Change Log

    Version 2.0 (Current)

    Version 1.0