Skip to content
GitmoapAPIBeta
Identity & platformtemplates
GET/templates/{template_kind}/{template_key}

Get a file template

get_template
  • Public
    This operation declares no security requirement: it takes no token.
  • Conditional · 304
    Declares 304 Not Modified.

One template with its content. A field the content asks for is written {{name}} where its value goes.

Parameters

Path
  • template_kindTemplateKindlicensegitignorechangelogcontributingcode_of_conductsecuritycatalogThe kind of template
  • template_keystringThe template's key within its kind, e.g. mit

Responses

200The templateapplication/json
  • contentstringThe file's text, each field written as {{name}} where its value goes.
  • default_pathstring
  • fieldsarray of TemplateField
    • The TemplateField schema
    • labelstringWhat to call it next to the input that fills it in.
    • namestringThe placeholder's name — year stands for {{year}}.
  • keystring
  • kindTemplateKindlicensegitignorechangelogcontributingcode_of_conductsecuritycatalogWhat a template is for.
  • namestring
  • spdx_idstring or nulloptional
  • summarystring or nulloptional
200 exampleSynthesized example
{
"content": "content-8f41",
"default_path": "default-path-8c78",
"fields": [
{
"label": "label-7f74",
"name": "payments-api"
}
],
"key": "key-ac3d",
"kind": "license",
"name": "payments-api",
"spdx_id": "c52d2239-bc28-4eed-ba3e-71caf173f924",
"summary": "summary-261b"
}
304The template has not changed since the validator was issued

No body.

404No template of that kind and keyapplication/json
Error codes
  • NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-9aec",
"message": "Pin a page's payload to the build that rendered it"
}
}

CLI

gitmoap templates get-template

  • --template-kindenumThe kind of template
  • --template-keystringThe template's key within its kind, e.g. `mit`

Used in these guides