GET/api/v1/projects/{project_id}/templates/{template_id}
get_template
Reads the latest version of a template, with its sources.
- Call it
- before saving a new version, to start from what is there.
- Needs
- an admin key with
project_id, or a project key with scoperead(its own project; the argument is ignored). - Returns
- the template, the same as
GET /api/v1/projects/{project_id}/templates/{template_id}.
Arguments
- object
-
template_idstring · uuidrequiredThe template’s id.
-
project_idstring · uuid | nullThe template’s project. An admin key must pass it; a project key’s own project is used and this is ignored.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
created_atstring · date-timeWhen this version was saved.
-
engineEngineOutputThe template engine.
- minijinja
-
html_bodystring -
idstring · uuidThe template’s id, the same in every version.
-
What a template is.
messageA message: subject, HTML, text.partialA fragment other templates include. -
namestring -
project_idstring · uuid -
subjectstring | nullnullfor a partial. -
text_bodystring | nullnull: the text is made from the HTML when the message is sent. -
versioninteger · uint32From 1, one more at each save.
≥ 0
Definitions
EngineOutput
The template engine.
string · enum
- minijinja
TemplateKindOutput
What a template is.
string · enum
message A message: subject, HTML, text.
partial A fragment other templates include.
Errors
A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors
HTTP API
The same operation over HTTP: GET /api/v1/projects/{project_id}/templates/{template_id}