Get a template
GET
/v1/templates/{id}
curl -H "X-Api-Key: $KEY" "http://localhost:9027/v1/templates/$ID"const response = await fetch(`http://localhost:9027/v1/templates/${process.env.ID}`, { 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']}", 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") 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) }}One template’s details.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
The template’s id, or an alias as name or name@version
Responses
Section titled “Responses”The template
Media typeapplication/json
A stored template.
object
createdAt
required
RFC 3339.
string
format
required
string
id
required
Pass as templateId to /v1/render, /v1/render/batch or /v1/templates/validate,
or point an alias at it with PUT /v1/aliases/{name}.
string
name
required
string
sha256
required
Hex SHA-256 of the content.
string
size
required
integer format: int64
Example
{ "format": "docx", "id": "01966f3e-7c1a-7d3c-9a44-1d2f5a6b7c8d", "name": "invoice.docx"}This caller has no such template
Media typeapplication/json
The JSON body of every error response.
object
error
required
A stable, machine-readable kind.
string
message
required
What went wrong, for a person.
string
Example
{ "error": "invalid_request", "message": "unknown step 'teleport'"}RUSTICDOC_STORE is not set
Media typeapplication/json
The JSON body of every error response.
object
error
required
A stable, machine-readable kind.
string
message
required
What went wrong, for a person.
string
Example
{ "error": "invalid_request", "message": "unknown step 'teleport'"}The store cannot be reached
Media typeapplication/json
The JSON body of every error response.
object
error
required
A stable, machine-readable kind.
string
message
required
What went wrong, for a person.
string
Example
{ "error": "invalid_request", "message": "unknown step 'teleport'"}