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/replaceParameters
Query Parameters
| Name | Type | Description |
|---|---|---|
| template | string | Inline template string that contains [[tokens]]. |
| template_url | string | HTTPS URL pointing to the template contents. |
| template_base64 | string | Base64 encoded template text (UTF-8). |
| replacements | string | JSON object as a string containing replacement values. |
| replacements_url | string | HTTPS URL returning a JSON object of replacements. |
| strict | boolean | When true, missing replacements raise an error instead of leaving tokens untouched. |
| dryrun | boolean | If 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"
}
}
]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.