Skip to main content

Report Flow API - Getting Started

Welcome to the Report Flow API! This guide will help you generate PDFs in 5 minutes.

⚡ 5-Minute Quick Start

Step 1: Get API Keys (1 minute)

Access the Report Flow admin panel and get the following information:

  1. Navigate to Workspace SettingsAPI Keys
  2. Copy the following:
    • AppKey: your-app-key
    • SecretKey: your-secret-key (only shown once)
    • WorkspaceId: your-workspace-id
tip

SecretKey is only shown on first display. Store it securely.

Step 2: Check Design ID (1 minute)

  1. Go to Design Management
  2. Select the design you want to use
  3. Copy the Design ID (e.g., 550e8400-e29b-41d4-a716-446655440000)

Step 2.5: Check Parameter Structure (1 minute, Optional)

Check the parameter structure required by the design:

curl -X GET https://your-workspace-id.re-port-flow.com/v1/file/design/parameter/550e8400-e29b-41d4-a716-446655440000 \
-H "AppKey: your-app-key" \
-H "SecretKey: your-secret-key"

Response example:

{
"customerName": "string",
"invoiceNumber": "string",
"amount": "number"
}
tip

For details on parameter structure, see the Design Parameters Guide.

Step 3: Generate Your First PDF (3 minutes)

Run the following cURL command in your terminal:

curl -X POST https://your-workspace-id.re-port-flow.com/v1/file/sync/single \
-H "Content-Type: application/json" \
-H "AppKey: your-app-key" \
-H "SecretKey: your-secret-key" \
-d '{
"designId": "550e8400-e29b-41d4-a716-446655440000",
"version": 1,
"content": {
"fileName": "invoice.pdf",
"params": {
"customerName": "John Doe",
"invoiceNumber": "INV-2024-001",
"amount": 10000
}
}
}' \
--output my-first-pdf.pdf
success

On success, my-first-pdf.pdf will be saved to the current directory!

🎯 Main Use Cases

Use Case 1: Instant Invoice Generation

Generate and download PDFs instantly when users click a button.

Endpoint: Sync Single PDF Generation

// On button click
async function downloadInvoice(invoiceId) {
const pdf = await generatePDF({
designId: 'invoice-template',
version: 1,
fileName: `invoice_${invoiceId}.pdf`,
data: invoiceData
});

// Download in browser
downloadFile(pdf, `invoice_${invoiceId}.pdf`);
}

Use Case 2: Bulk Monthly Report Generation

Generate reports for all customers at month-end and send via email.

Endpoint: Async Multiple PDF Generation

// Batch processing
async function generateMonthlyReports(customers) {
const contents = customers.map(customer => ({
fileName: `report_${customer.id}.pdf`,
params: customer.data
}));

const result = await generateMultiplePDFsAsync('report-template', contents);

// Send emails to each customer
await sendEmailsWithPDFs(result);
}

Use Case 3: Preview Feature

Real-time preview in design editor.

Endpoint: Sync Single PDF Generation

// On preview button click
async function showPreview(designId, params) {
const pdf = await generatePDF({
designId,
version: 1,
fileName: 'preview.pdf',
data: params
});

// Display in browser
openPDFInNewTab(pdf);
}

🧭 API Overview

PDF Generation Endpoints

EndpointPurposeTimeoutResponse
POST /file/sync/singleSync single PDF30 secPDF file
POST /file/async/singleAsync single PDFNoneURL + fileId
POST /file/sync/multipleSync multiple PDFs30 secZIP file
POST /file/async/multipleAsync multiple PDFsNoneURL + fileId

Other Endpoints

EndpointDescription
GET /file/download/{uuid}Bulk ZIP download
GET /file/download/{uuid}/{fileId}Individual file download
GET /file/design/parameter/{designId}Get design parameters

📚 Next Steps

🔧 Limitations

  • Request Size: Maximum 20MB (after Base64 encoding)
  • File Name: Only alphanumeric, Japanese, -, _, . allowed
  • Authentication: workspaceId in subdomain must match

💡 Sample Code

JavaScript (Node.js)

const axios = require('axios');

async function generatePDF() {
const response = await axios.post(
'https://your-workspace-id.re-port-flow.com/v1/file/sync/single',
{
designId: '550e8400-e29b-41d4-a716-446655440000',
version: 1,
content: {
fileName: 'invoice.pdf',
params: {
customerName: 'John Doe',
invoiceNumber: 'INV-2024-001',
amount: 10000
}
}
},
{
headers: {
'AppKey': 'your-app-key',
'SecretKey': 'your-secret-key'
},
responseType: 'arraybuffer'
}
);

return response.data;
}

Python

import requests

def generate_pdf():
url = 'https://your-workspace-id.re-port-flow.com/v1/file/sync/single'
headers = {
'AppKey': 'your-app-key',
'SecretKey': 'your-secret-key',
'Content-Type': 'application/json'
}
data = {
'designId': '550e8400-e29b-41d4-a716-446655440000',
'version': 1,
'content': {
'fileName': 'invoice.pdf',
'params': {
'customerName': 'John Doe',
'invoiceNumber': 'INV-2024-001',
'amount': 10000
}
}
}

response = requests.post(url, headers=headers, json=data)
return response.content

🆘 Support

For questions or support, please contact: