List a template's variables
curl -H "X-Api-Key: $KEY" "http://localhost:9027/v1/templates/$ID/variables"const response = await fetch(`http://localhost:9027/v1/templates/${process.env.ID}/variables`, { headers: { 'X-Api-Key': process.env.KEY },});if (!response.ok) throw new Error(await response.text());console.log(await response.json());import os
import requests
response = requests.get( f"http://localhost:9027/v1/templates/{os.environ['ID']}/variables", headers={"X-Api-Key": os.environ["KEY"]},)response.raise_for_status()print(response.json())package main
import ( "io" "log" "net/http" "os")
func main() { url := "http://localhost:9027/v1/templates/" + os.Getenv("ID") + "/variables" request, err := http.NewRequest("GET", url, nil) if err != nil { log.Fatal(err) } request.Header.Set("X-Api-Key", os.Getenv("KEY"))
response, err := http.DefaultClient.Do(request) if err != nil { log.Fatal(err) } defer response.Body.Close() if response.StatusCode >= 300 { message, _ := io.ReadAll(response.Body) log.Fatalf("%s: %s", response.Status, message) } if _, err := io.Copy(os.Stdout, response.Body); err != nil { log.Fatal(err) }}Lists the data a template reads: each path, which paths are arrays it loops
over, and the fields it reads from their items, with a skeleton of data.
Read from the template’s tags, so a path built at render time, such as
row[column], is listed only as far as it is written.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The template’s id, or an alias as name or name@version
Responses
Section titled “Responses”What the template reads
What a stored template reads from its data.
object
Data of the right shape, with empty strings where values go.
object
The template’s id, also when it was asked for by alias.
Every path the template reads, parents first: customer.name, items
(an array), items[].price. For a PDF form, its fields’ names and the
tags in their values; tags in annotations are not listed.
One path the template reads.
object
Dotted, with [] for each item of an array: items[].price. items[]
itself says what each item is.
What a template does with a path.
Example
{ "format": "docx", "variables": [ { "path": "items[].price", "type": "value" } ]}This caller has no such template
The JSON body of every error response.
object
A stable, machine-readable kind.
What went wrong, for a person.
Example
{ "error": "invalid_request", "message": "unknown step 'teleport'"}The template has syntax errors
The JSON body of every error response.
object
A stable, machine-readable kind.
What went wrong, for a person.
Example
{ "error": "invalid_request", "message": "unknown step 'teleport'"}RUSTICDOC_STORE is not set
The JSON body of every error response.
object
A stable, machine-readable kind.
What went wrong, for a person.
Example
{ "error": "invalid_request", "message": "unknown step 'teleport'"}The store cannot be reached
The JSON body of every error response.
object
A stable, machine-readable kind.
What went wrong, for a person.
Example
{ "error": "invalid_request", "message": "unknown step 'teleport'"}