Complete
Documentation

Everything you need to get started with SwishDocs. From quick setup to advanced integrations.

Quick Start Guide

Get up and running with SwishDocs in just a few minutes.

1

Create Your First Template

Set up a Google Doc with placeholder variables like {{name}} and {{amount}}.

2

Connect Your Data

Use Google Sheets, Airtable, or our API to send data to SwishDocs.

3

Generate PDFs

Send a request to our API and receive branded download links.

Code Examples

Real-world examples to help you integrate SwishDocs into your workflow.

Generate PDF from Google Sheets

javascript
// Using Google Apps Script
function generatePDF() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const data = sheet.getDataRange().getValues();
  
  data.forEach((row, index) => {
    if (index === 0) return; // Skip header
    
    const payload = {
      template: {
        type: 'gdoc',
        id: 'YOUR_GOOGLE_DOC_ID'
      },
      data: {
        name: row[0],
        amount: row[1],
        date: row[2]
      },
      pdfName: `Invoice_${row[0]}_${index}`
    };
    
    const response = UrlFetchApp.fetch('https://api.swishdocs.com/generate', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      payload: JSON.stringify(payload)
    });
    
    const result = JSON.parse(response.getContentText());
    sheet.getRange(index + 1, 4).setValue(result.link);
  });
}

Python API Integration

python
import requests
import json

def generate_pdf(template_id, data, pdf_name):
    url = "https://api.swishdocs.com/generate"
    headers = {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    
    payload = {
        "template": {
            "type": "gdoc",
            "id": template_id
        },
        "data": data,
        "pdfName": pdf_name
    }
    
    response = requests.post(url, headers=headers, json=payload)
    return response.json()

# Example usage
result = generate_pdf(
    template_id="1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
    data={
        "name": "John Doe",
        "amount": "$1,500.00",
        "due_date": "2024-01-15"
    },
    pdf_name="Invoice_John_Doe"
)

print(f"PDF Link: {result['link']}")

Zapier Integration

json
{
  "trigger": "New Row in Google Sheets",
  "action": "Webhooks by Zapier",
  "url": "https://api.swishdocs.com/generate",
  "method": "POST",
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "data": {
    "template": {
      "type": "gdoc",
      "id": "{{Google Sheets:Document ID}}"
    },
    "data": {
      "name": "{{Google Sheets:Name}}",
      "amount": "{{Google Sheets:Amount}}",
      "date": "{{Google Sheets:Date}}"
    },
    "pdfName": "Invoice_{{Google Sheets:Name}}_{{Google Sheets:Row Number}}"
  }
}

Frequently Asked Questions

Common questions about using SwishDocs.

How do I create a template with placeholders?

In your Google Doc, add placeholders using double curly braces like {{name}}, {{amount}}, {{date}}. These will be replaced with actual data when generating PDFs.

What file formats are supported?

We support Google Docs as templates and generate PDFs as output. You can also import Word documents by converting them to Google Docs first.

How do I get my API key?

Sign up for a free account and navigate to the API section in your dashboard. Your API key will be displayed there.

Can I customize the PDF output?

Yes! You can customize fonts, colors, layouts, and add watermarks. Advanced customization options are available in our Professional and Enterprise plans.

How long are the generated PDF links valid?

By default, links are valid for 30 days on the Starter plan and 1 year on Professional plans. Enterprise customers can set custom expiry times.

Is there a rate limit on the API?

Yes, we have rate limits to ensure fair usage. Starter plans have 100 requests per minute, Professional plans have 500, and Enterprise plans have custom limits.

Ready to Get Started?

Start building with SwishDocs today. No credit card required.