User Tools

Site Tools


api:messagetemplates:get

API : Message templates : Get

Introduction

One template in one language as it is in use in the scope, what it falls back to when the scope's version is reverted, the variables it can use with example values, and its history. See messagetemplates.

Request

URL https://api.telecomx.dk/messagetemplates/CHANNEL/KEY/LANGUAGE
Method GET
Access level As List, and the template must be visible in the scope.
Param CHANNEL String EMAIL, SMS or PDF.
KEY String Key of the template, see List.
LANGUAGE String da or en - one of the template's languages.
Query reseller Id [optional] Reseller whose own version is wanted. Without it, the master template.

Query example

https://api.telecomx.dk/messagetemplates/EMAIL/employeePasswordResetLink/da?reseller=64b000000000000000000001

Response

The template's fields from List (channel, key, languages, audience, sensitive, resellerEditable, description), and:

Field Type Description
language String The language asked for.
writable Boolean True when the user may save, revert and test it in this scope.
template Object The template in use: subject (empty for SMS and PDF), body, source - RESELLER (the reseller's version) or MASTER (the master template). Null when the template has no master version yet (nor a version of the reseller): the editor starts empty, and the message is not sent until one is saved.
edited Object updatedAt and updatedByName of the scope's edited version, null when there is none.
fallback Object What is used when the reseller's version is reverted - the master template: subject, body, source. Null for the master templates, which cannot be reverted.
variables Array { name, sample } per variable the template can use, with the example value used by Preview (in a reseller's scope its own name, phone, e-mail and portal).
revisions Array Replaced versions, newest first: _id, updatedAt, updatedByName (who saved it), replacedAt.

Example

{
  channel: 'EMAIL', key: 'employeePasswordResetLink', language: 'da', languages: ['da', 'en'], audience: 'CUSTOMER', sensitive: true,
  resellerEditable: true, writable: true, description: { da: 'Link til at nulstille adgangskoden', en: 'Link to reset the password' },
  template: { subject: 'Nulstilling af adgangskode', body: '<h2>Nulstil din adgangskode</h2>...', source: 'RESELLER' },
  edited: { updatedAt: '2026-10-30T14:59:12.000Z', updatedByName: 'Jens Hansen' },
  fallback: { subject: 'Nulstilling af adgangskode', body: '...', source: 'MASTER' },
  variables: [ { name: 'link', sample: 'https://admin.telecomx.dk/#/example-link' }, { name: 'brandLinkColor', sample: '[brandLinkColor]' } ],
  revisions: []
}

Errors

Error code Message Description
403 access_denied Insufficient access level
404 template Template not found, not in this language, or not in this scope
404 reseller Reseller not found
422 channel/key/language/reseller Not a valid value
500 internal_error <Unspecified>
api/messagetemplates/get.txt · Last modified: by Telecom X AI

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki