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"Antwort200
{
"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.
Parameter
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.
Antwort-Payload
id
string
erforderlich
Template ID.
workspace_id
nullable string
erforderlich
The workspace that owns the template. Null for a built-in system template.
slug
string
erforderlich
The immutable handle used to address and send the template. A built-in template's slug starts with bird_.
name
string
erforderlich
The template's display name. It defaults to the slug and can be changed on workspace templates.
description
nullable string
erforderlich
What the template is for. Null if it has no description.
scope
string
erforderlich
Whether the template is one of our built-in templates (system) or one your workspace created (workspace).
Possible values: system, workspace
status
string
erforderlich
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
erforderlich
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
erforderlich
The permanent editable draft version. Null for a built-in template.
live_version_id
nullable string
erforderlich
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
erforderlich
Deprecated. Use live_version_id, which carries the same value.
revision
nullable integer
erforderlich
The draft revision to use for concurrent-edit checks. Null for a built-in template.
languages
object
erforderlich
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
erforderlich
The draft's default language. Sends continue using the live version's default until the draft is published.
available_languages
array of string
erforderlich
Languages the live version can currently send. Empty before first publication.
on_missing_language
string
erforderlich
How a send handles a requested language that the live version does not have.
language_source_required
boolean
erforderlich
Whether each send must name a language instead of using the live version's default.
last_submitted_at
nullable string
erforderlich
When the template was last published. Null before first publication and for built-in templates.
created_at
nullable string
erforderlich
When the template was created. Null for built-in templates.
updated_at
nullable string
erforderlich
When the template was last modified. Null for built-in templates.
Verwandte Ressourcen
Weiter mit der Dokumentation, Anleitungen und Beispielen zu diesem Thema. Die Ressourcen sind auf Englisch.
Anleitung ansehenSending an SMS with a templateDas Tool verwendenPreview message segmentsDie Funktion erkundenSMS content and templatesDem Lernpfad folgenBuild your first integration
Übung ausprobieren und ein Implementierungs-Briefing erhalten