bird whatsapp templates versions languages set
Usage
代码示例
bird whatsapp templates versions languages set <template-ref> <version-id> <language> [flags]Description
Write one language of a WhatsApp template's draft
This replaces the language, it does not merge: send its complete content every
time. Only the draft is writable. A submitted version is immutable, and a
language under review at WhatsApp refuses the write until that review finishes.
"bird whatsapp templates get <slug>" reports the draft's id in
"draft_version_id"; "bird whatsapp templates versions create" opens one if there
is none.
Content goes in through --body-file: "components" is an array of blocks, each
carrying nested arrays of its own, a shape no flag can express. A body block is
required before the language can be submitted, and every variable in a block
needs an example value, which is what WhatsApp reviews against.
Nothing here reaches WhatsApp. Submit the draft once every language is ready.
Build the request from flags, a JSON WhatsAppTemplateLanguageUpsert body via --body-file ("-" reads
stdin), or both — a flag overrides the matching body field. Run --example to
print a ready-to-edit body, or --dry-run to print the resolved request without
sending it.
Procedure
Step 4 of 7 of "Author a WhatsApp template and get it approved". Previous: bird whatsapp templates versions create. Next: bird whatsapp templates versions submit.
Examples
代码示例
# print the body shape (no credentials needed)
bird whatsapp templates versions languages set --example
# the body it prints:代码示例
{
"components": [
{
"code_expiration_minutes": 60,
"text": "Your order {{order_id}} has shipped.",
"type": "body"
}
],
"revision": 4
}代码示例
# write the English content of a draft
bird whatsapp templates versions languages set order_update wav_01krdgeqcxet5s7t44vh8rt9mg en --body-file en.json
# write it only if nobody has edited it since you read revision 4
bird whatsapp templates versions languages set order_update wav_01krdgeqcxet5s7t44vh8rt9mg en --body-file en.json --revision 4Options
Concurrency
| Name | Description |
|---|---|
| --revision <n> | The revision you last read for this language, making the write a compare-and-set: a mismatch is refused rather than overwriting an edit you have not seen. Omit it for last-write-wins, which is what a single writer wants |
Request
| Name | Description |
|---|---|
| --body-file | Read the JSON request body from this file; "-" reads stdin |
| --example | Print a complete example request body, then exit |
| --dry-run | Print the resolved request without sending it, then exit |
| --idempotency-key | Deduplication key; a retry with the same key won't act twice |
Options
| Name | Description |
|---|---|
| --response-schema | Print the fields this command returns, then exit |
Related
| Name | Description |
|---|---|
| bird whatsapp templates versions languages delete | Delete a language from the draft |
| bird whatsapp templates versions languages discard | Discard a language's draft edits back to its submitted copy |
| bird whatsapp templates versions languages get | Get a version's language |
| bird whatsapp templates versions languages list | List a version's languages |