Get an SMS template
GET
/v1/sms/templates/{template_ref}
const tpl = await bird.smsTemplates.get("bird_otp_verification");
console.log(tpl.default_language, tpl.live_version_id);template = client.sms_templates.get("bird_otp_verification")
print(template.default_language, template.live_version_id)tpl, err := client.SmsTemplates.Get(context.Background(), "bird_otp_verification")
if err != nil {
log.Fatal(err)
}
fmt.Println(tpl.DefaultLanguage, *tpl.LiveVersionId)$template = $bird->smsTemplates->get('bird_otp_verification');
echo $template->getDefaultLanguage(), ' ', $template->getLiveVersionId();bird sms templates get <template-ref>curl -X GET "https://us1.platform.bird.com/v1/sms/templates/{template_ref}" \
-H "Authorization: Bearer $TOKEN"Reactie200
{
"id": "smt_01krdgeqcxet5s7t44vh8rt9mg",
"workspace_id": "ws_01krdgeqcxet5s7t44vh8rt9mg",
"slug": "order-shipped",
"name": "Order shipped",
"scope": "system",
"status": "active",
"category": "transactional",
"draft_version_id": "smv_01krdgeqcxet5s7t44vh8rt9mg",
"live_version_id": "smv_01krdgeqcxet5s7t44vh8rt9mg",
"published_version_id": "smv_01krdgeqcxet5s7t44vh8rt9mg",
"languages": {
"en": {
"status": "live"
},
"nl": {
"status": "live",
"draft": true
}
},
"default_language": "pt-BR",
"available_languages": [
"en"
],
"on_missing_language": "fallback"
}
Returns one SMS template's metadata, policies, language states, draft revision, and draft and live version IDs. The response is shallow; read a version to retrieve content and variables. An unknown or deleted template returns 404.
Parameters
template_ref
string
The template's ID (smt_…) or slug. Built-in templates use a bird_ slug. Write operations accept workspace templates because built-in templates are read-only.
Response Payload
id
string
verplicht
Template ID.
workspace_id
nullable string
verplicht
The workspace that owns the template. Null for a built-in system template.
slug
string
verplicht
The immutable handle used to address and send the template. A built-in template's slug starts with bird_.
name
string
verplicht
The template's display name. It defaults to the slug and can be changed on workspace templates.
description
nullable string
verplicht
What the template is for. Null if it has no description.
scope
string
verplicht
Whether the template is one of our built-in templates (system) or one your workspace created (workspace).
Possible values: system, workspace
status
string
verplicht
Where the template stands as a whole. The same five states on every channel.
- draft: nothing has ever gone live.
- pending: nothing is live and at least one language is in review.
- active: at least one language is live, so something can be sent.
- rejected: it was reviewed and every language was refused.
- inactive: nothing is live and nothing is in review, so content was withdrawn or was blocked before anything went live.
A template with one language live is active even while another is still
drafted or refused. Read languages for the state of each language and its
reason.
Which values a channel reports follows its review model. A channel whose
content a third party reviews uses all five. On email and SMS, where content
goes live on publish, a template is draft, active or inactive, and
pending and rejected are reserved for the review stage coming to both, so
a template reaching either is not a breaking change.
Possible values: draft, pending, active, rejected, inactive
category
string
verplicht
Why messages use this template. Use authentication for one-time codes, marketing for promotions, and transactional for service messages.
Possible values: transactional, marketing, authentication
draft_version_id
nullable string
verplicht
The permanent editable draft version. Null for a built-in template.
live_version_id
nullable string
verplicht
The version sends resolve to, or null before a workspace template is first published. A built-in template points to a synthetic published version that projects its current catalogue content.
published_version_id
nullable string
verplicht
Deprecated. Use live_version_id, which carries the same value.
revision
nullable integer
verplicht
The draft revision to use for concurrent-edit checks. Null for a built-in template.
languages
object
verplicht
Each language the template has, keyed by canonical BCP-47 tag, with its live state and whether the draft contains unpublished changes. Content is available from version reads.
default_language
string
verplicht
The draft's default language. Sends continue using the live version's default until the draft is published.
available_languages
array of string
verplicht
Languages the live version can currently send. Empty before first publication.
on_missing_language
string
verplicht
How a send handles a requested language that the live version does not have.
language_source_required
boolean
verplicht
Whether each send must name a language instead of using the live version's default.
last_submitted_at
nullable string
verplicht
When the template was last published. Null before first publication and for built-in templates.
created_at
nullable string
verplicht
When the template was created. Null for built-in templates.
updated_at
nullable string
verplicht
When the template was last modified. Null for built-in templates.
Gerelateerde bronnen
Ga verder met de documentatie, gidsen en voorbeelden voor dit onderwerp. De bronnen zijn in het Engels.
Bekijk de gidsSending an SMS with a templateGebruik de toolPreview message segmentsOntdek de mogelijkheidSMS content and templatesVolg het leerpadBuild your first integration
Probeer de oefening en ontvang een implementatieoverzicht