Get SMS template by ID

GET /api/communications/sms-templates/{templateId}

Success: 200 OK

Overview

Returns one SMS template with its message text in every language it has been written in.

An SMS template is the body used when a communication job sends by text; the text is stored once per language and the entry matching the recipient is chosen when the message is sent. Use this to show or verify a template before attaching it to a scheduled job.

The template is returned whether or not it is enabled, so check isActive before relying on it: sending with a disabled template fails at send time with the template reported as non-existent.

Endpoint

GET {base_url}/api/communications/sms-templates/{templateId}

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
templateIdinteger (int32)YesThe template to return. Must be 1 or greater — 0 and negative values are rejected as invalid rather than treated as not found — and a non-integer segment fails at routing with 400.

Sample request

cURL
curl -X GET '{base_url}/api/communications/sms-templates/{templateId}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'

Response fields

FieldTypeDescription
idinteger (int32)The template's identifier, echoed back.
templateNamestringThe template's name, up to 255 characters. It identifies the template to staff and is never part of the message a recipient receives.
isActivebooleanWhether the template may be used for sending. An inactive template is still returned here, but any send that references it fails.
contentarray of objectThe message text, one entry per language. Empty when no text has been written for the template yet.
content[].languagestringThe language this text is written in, as a language code — en-GB, cy-GB and en-IE are the codes installed by default.
content[].contentstringThe message text for that language, up to 1024 characters.

Sample response

200 OK
{
  "id": 12345,
  "templateName": "string",
  "isActive": true,
  "content": [
    {
      "language": "string",
      "content": "string"
    }
  ]
}

Errors

StatusMeaningWhen
400Bad requesttemplateId is zero or negative (SMS template ID must be a positive integer), or the path segment is not an integer (The value 'A' is not valid.).
404Not foundNo SMS template with that id in this tenant (SMS template with ID {templateId} doesn't exist.).
500Internal server errorAn unexpected failure reading the template. The response has no body.

This page as markdown · All pages · llms.txt