Skip to content
Last updated

Get a template

Use these endpoints to retrieve a template by language or to list all available language variants.
Before making requests, ensure you have configured authentication.

For the full technical reference, see the OpenAPI specification.


Get template by language

Retrieves a specific template by its ID and language.

Endpoint

GET /api/template/{templateId}

Headers

NameRequiredDescription
AuthorizationYesBasic Auth credentials. See Authentication.
X-Api-KeyYesAPI key for the account. See Authentication.

Path parameters

ParameterTypeRequiredDescription
templateIdintegerYesThe template ID to retrieve

Query parameters

ParameterTypeRequiredDescription
languagestringYesThe template language code (e.g. it, en)

Request example

GET /api/template/9?language=en

Response examples

200 — Utility template

{
  "body": {
    "text": "Hello *{{1}}*, your signature is required for a document. Open by using following link:",
    "parameters": [
      { "text": "John Smith" }
    ]
  },
  "urlButtons": [
    {
      "index": 0,
      "urlPath": "sign",
      "url": "https://yourendpoint.com/{{1}}",
      "text": "Open Document"
    }
  ],
  "textHeader": {
    "text": "Document signing request"
  },
  "language": "en",
  "status": "APPROVED",
  "category": "UTILITY",
  "name": "signature_template",
  "description": "sign a doc using a link",
  "templateId": "9",
  "default": true
}

200 — Authentication template

{
  "body": {
    "text": "*{{1}}* è il tuo codice di verifica. Per garantire la tua sicurezza, ti consigliamo di non condividere questo codice.",
    "parameters": [
      { "text": "123456" }
    ]
  },
  "urlButtons": [
    {
      "index": 0,
      "urlPath": "123456",
      "url": "https://www.whatsapp.com/otp/code/?otp_type=COPY_CODE&code_expiration_minutes=10&code=otp{{1}}",
      "text": "Copia codice"
    }
  ],
  "footer": {
    "text": "Scade tra 10 minuti.",
    "codeExpirationMinutes": 10
  },
  "language": "it",
  "status": "APPROVED",
  "category": "AUTHENTICATION",
  "name": "authentication_template",
  "description": "auth",
  "templateId": "1",
  "default": false
}

The response fields are:

FieldTypeDescription
templateIdstringThe template ID
namestringThe template name. Only alphabetic characters and underscores (max 100 characters)
descriptionstringThe template description
languagestringThe template language code. See supported languages
statusstringApproval status: PENDING, APPROVED, or REJECTED
categorystringTemplate category: UTILITY, MARKETING, or AUTHENTICATION
defaultbooleanWhether this is the default language variant for the template
bodyobjectBody component. See Body component for details on how placeholders and parameters work
urlButtonsarrayURL buttons defined in the template. Each entry has index (zero-based position), text (button label), url (base URL with optional {{1}} placeholder), and urlPath (default path appended to the URL). Empty array [] if none. Max 2 buttons
textHeaderobjectHeader text component, if present. Not present in AUTHENTICATION templates
footerobjectFooter text component, if present. For AUTHENTICATION templates, includes codeExpirationMinutes (OTP expiration time in minutes)

404 — Template not found

{
  "type": "UnavailableTemplateException",
  "code": 7,
  "message": "Invalid template"
}

Error codes

HTTP StatusError codeError typeSolution
4047UnavailableTemplateExceptionVerify that the templateId and language exist

For authentication errors (code 1, 6, 9), see Authentication.


Get template languages

Returns all available language variants for a specific template.

Endpoint

GET /api/template/{templateId}/languages

Headers

NameRequiredDescription
AuthorizationYesBasic Auth credentials. See Authentication.
X-Api-KeyYesAPI key for the account. See Authentication.

Path parameters

ParameterTypeRequiredDescription
templateIdintegerYesThe template ID

Request example

GET /api/template/9/languages

Response examples

200 — Languages list

["de", "en", "fr", "it"]

The response is an array of language codes. Each code follows the format defined by Meta. See supported languages for the full list of valid values.

404 — Template not found

{
  "type": "UnavailableTemplateException",
  "code": 7,
  "message": "Invalid template"
}

Error codes

HTTP StatusError codeError typeSolution
4047UnavailableTemplateExceptionVerify that the templateId exists

For authentication errors (code 1, 6, 9), see Authentication.