Dataczar
Browse helpers

Render Mustache templates using inline text, URLs, or base64.

Accepts a Mustache template and JSON data payload, renders the final output, and returns the rendered string. Supports GET-first usage as well as POST with structured JSON. Drop this helper wherever you want to render Mustache templates using inline text, URLs, or base64 with a single HTTP call. Send the documented inputs and the API streams back polished results you can hand directly to your users.

GETPOST/templates/mustache/render

Parameters

Query Parameters

NameTypeDescription
templatestringInline Mustache template string.
template_urlstringHTTPS URL pointing to the template contents.
template_base64stringBase64 encoded template text (UTF-8).
datastringJSON object as a string containing replacements.
data_urlstringHTTPS URL returning a JSON object for replacements.
partialsstringJSON object mapping partial names to template strings.
partials_urlstringHTTPS URL returning JSON partials.
dryrunbooleanIf present (and not explicitly false), renders in preview mode.

All helper calls accept your Dataczar key via the ak query parameter. Need one? Create or copy a key on Dataczar Connect and drop it into each request.

Responses

Status 200

Template rendered successfully.

{
  "ok": true,
  "data": {
    "rendered": "<h1>Hello Jamie</h1>",
    "length": 19
  },
  "meta": {
    "service": "tmpl/mustache-render",
    "dryrun": false,
    "request_id": "req_123"
  }
}

Examples

Request

"GET /tmpl/mustache/render?template=%3Ch1%3E{{title}}%3C/h1%3E&data=%7B%22title%22%3A%22Hi%22%7D&ak=demo"

Response

{
  "ok": true,
  "data": {
    "rendered": "<h1>Hi</h1>",
    "length": 10
  },
  "meta": {
    "dryrun": false
  }
}

Request

"POST /tmpl/mustache/render"

Body

{
  "template": "<p>{{greeting}}, {{name}}!</p>",
  "data": {
    "greeting": "Hello",
    "name": "Jamie"
  },
  "dryrun": true
}

Response

{
  "ok": true,
  "data": {
    "rendered": "<p>Hello, Jamie!</p>",
    "length": 18
  },
  "meta": {
    "dryrun": true
  }
}

Test Contracts

[
  {
    "name": "basic_render",
    "method": "POST",
    "body": {
      "template": "{{title}} world",
      "data": {
        "title": "Hello"
      }
    },
    "expect": {
      "rendered": "Hello world"
    }
  }
]

File uploads (multipart form-data)

Attach PDFs or images as multipart fields. We'll fill in the field names for you.

Files
file

Query parameters

Equivalent curl

Grab your Dataczar API key

Every helper runs with the same simple API key. Sign in (or create a free Dataczar account) at Dataczar Connect to issue keys in seconds, then drop the key into any `ak=` parameter and start shipping.

Tip: reuse the same key across these helpers, or rotate keys per project from the Connect dashboard.