1
0 Comments

πŸŽ‰ Just shipped: A tiny feature making API integration dead simple for Doxy users

Hey IH! Quick update on Doxy (Google Docs β†’ PDF templating engine) that I think fellow makers might find interesting from a UX (or rather, DX) perspective.

The Problem:

While building Doxy, I noticed users struggling with our API integration. They had templates in Google Docs but weren't sure how to translate their variables into API requests. Even with Swagger docs, there was friction in constructing the right request body.

The Solution:

Added a "Download JSON" button that leverages our existing template validation infrastructure. Here's what makes it special:

When you add a template to Doxy:

1. It gets thoroughly scanned and all variables are extracted (text, tables and images)

2. Each variable is rigorously validated for API compatibility

3. Template only gets accepted if all variables pass validation

Now, with the new JSON button, you can:

- Get a complete API request body for any validated template

- Receive properly structured JSON with VALUE_PLACEHOLDER markers

- Copy-paste directly into our Swagger docs to test the API

Tech detail for the curious: Our validation uses Unicode-aware regex (/^[\p{L}\p{N}_]+$/u) - supporting international variable names while ensuring they're safe for JSON. This means your templates can use variables like {{MΓΌnchen}} or {{piΓ±ata}}, making it truly international-friendly!

Example:

Template text: "Dear {{client_name}}, your order #{{order_id}} is ready"

↓

Generated JSON:

{
  "templateId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "variables": {
      "client_name": "VALUE_PLACEHOLDER",
      "order_id": "VALUE_PLACEHOLDER"
   }
}

Why This Matters:

1. Zero guesswork for API integration

2. Faster developer experience

3. Fewer support tickets about API usage

4. Makes testing in Swagger docs trivial

The beauty is in the simplicity - since we already validate everything upfront when templates are added, we can confidently generate API-ready JSON that just works.

posted toAvatar for product Doxy
Doxy