Dataczar
Browse helpers

Replace [[tokens]] inside a template using JSON data.

Performs a lightweight token replacement on templates that use double square brackets (e.g., [[name]]). Replacements can be specified inline, via JSON, or by URL. Nested keys can be referenced with dot notation (e.g., [[user.name]]).

GETPOST/templates/bracket/replace

Where this helper shines

Replace [[tokens]] inside a template using JSON data. keeps templates helpers on autopilot. Use it whenever you need to replace [[tokens]] inside a template using JSON data without pausing a sprint or asking design/dev to jump in.

  • Trigger this helper whenever you need to replace [[tokens]] inside a template using JSON data without waiting on a full deploy.
  • Drop it into automations (Zapier, Make, workers) to replace [[tokens]] inside a template using JSON data as part of your workflow.
  • Share the GET URL so support and success can replace [[tokens]] inside a template using JSON data safely using their Dataczar API key.

Copy & ship snippets

GET

Instant link

GET https://api.dataczar.app/templates/bracket/replace?template=sample-template&template_url=https%3A%2F%2Fexample.com%2Fdemo.png&template_base64=sample-template_base64&replacements=sample-replacements&ak=demo

Open directly in any browser, webhook, or low-code workflow.

curl

curl GET

curl "https://api.dataczar.app/templates/bracket/replace?template=sample-template&template_url=https%3A%2F%2Fexample.com%2Fdemo.png&template_base64=sample-template_base64&replacements=sample-replacements&ak=demo"

Swap ak=demo with your Dataczar API key.

curl

curl POST

curl -X POST "https://api.dataczar.app/templates/bracket/replace?ak=demo" \
  -H 'Content-Type: application/json' \
  -d '{
  "template": "sample_template",
  "template_url": "https://example.com/demo.png",
  "template_base64": "sample_template_base64",
  "replacements": "sample_replacements",
  "replacements_url": "https://example.com/demo.png",
  "strict": true,
  "dryrun": true
}'

Send JSON payloads from back-end jobs, queues, or workers.

Parameters

Query Parameters

NameTypeDescription
templatestringInline template string that contains [[tokens]].
template_urlstringHTTPS URL pointing to the template contents.
template_base64stringBase64 encoded template text (UTF-8).
replacementsstringJSON object as a string containing replacement values.
replacements_urlstringHTTPS URL returning a JSON object of replacements.
strictbooleanWhen true, missing replacements raise an error instead of leaving tokens untouched.
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": "Hello Jamie!",
    "length": 12
  },
  "meta": {
    "service": "tmpl/bracket-replace",
    "dryrun": false,
    "request_id": "req_123"
  }
}

Examples

Request

"GET /tmpl/bracket/replace?template=Welcome%20[[name]]&replacements=%7B%22name%22%3A%20%22Jamie%22%7D&ak=demo"

Response

{
  "ok": true,
  "data": {
    "rendered": "Welcome Jamie",
    "length": 13
  },
  "meta": {
    "dryrun": false
  }
}

Test Contracts

[
  {
    "name": "basic_bracket",
    "method": "POST",
    "body": {
      "template": "ID:[[user.id]]",
      "replacements": {
        "user": {
          "id": 42
        }
      }
    },
    "expect": {
      "rendered": "ID:42"
    }
  }
]

Query parameters

Body parameters

We'll send these as JSON for POST/PUT/PATCH requests and as query params for GET.

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.