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:
- Navigate to Workspace Settings → API Keys
- Copy the following:
- AppKey:
your-app-key - SecretKey:
your-secret-key(only shown once) - WorkspaceId:
your-workspace-id
- AppKey:
SecretKey is only shown on first display. Store it securely.
Step 2: Check Design ID (1 minute)
- Go to Design Management
- Select the design you want to use
- 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"
}
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
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
| Endpoint | Purpose | Timeout | Response |
|---|---|---|---|
| POST /file/sync/single | Sync single PDF | 30 sec | PDF file |
| POST /file/async/single | Async single PDF | None | URL + fileId |
| POST /file/sync/multiple | Sync multiple PDFs | 30 sec | ZIP file |
| POST /file/async/multiple | Async multiple PDFs | None | URL + fileId |
Other Endpoints
| Endpoint | Description |
|---|---|
| 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
- Design Parameters - How to check parameter structure
- Authentication Details
- PDF Generation Guide
🔧 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:
- Email: [email protected]