Discard a language's draft edits back to its submitted copy
/v1/whatsapp/templates/{template_ref}/versions/{version_id}/languages/{language}/discardconst restored = await bird.whatsapp.templates.versions.languages.discard(
"order_update",
"wav_01krdgeqcxet5s7t44vh8rt9mg",
"en",
);
console.log(restored.language, restored.revision);restored = client.whatsapp.templates.versions.languages.discard(
"order_update", "wav_01krdgeqcxet5s7t44vh8rt9mg", "en"
)
print(restored.language, restored.revision)restored, err := client.Whatsapp.Templates.Versions.Languages.Discard(context.Background(), "order_update", "wav_01krdgeqcxet5s7t44vh8rt9mg", "en",
bird.WhatsappTemplatesVersionsLanguagesDiscardParams{})
if err != nil {
log.Fatal(err)
}
fmt.Println(*restored.Language, *restored.Revision)$restored = $bird->whatsapp->templates->versions->languages->discard(
'order_update',
'wav_01krdgeqcxet5s7t44vh8rt9mg',
'en',
new WhatsAppTemplateLanguageDiscard(),
);
echo $restored->getLanguage(), ' ', $restored->getRevision(), "\n";bird whatsapp templates versions languages discard <template-ref> <version-id> <language> \
--revision 4 \
--yescurl -X POST "https://us1.platform.bird.com/v1/whatsapp/templates/{template_ref}/versions/{version_id}/languages/{language}/discard" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"revision": 4
}'{
"language": "pt-BR",
"revision": 4,
"content_hash": "sha256:9f2c4e1a7b03d85fbc6e29d417a05e8c3b1d9f76a2e4c018d53b7f9a6c2e18d4"
}
Restores one language of the template's draft to the copy the draft was branched from, discarding the edits made to it since. Only that language moves: every other language in the draft is left alone, which is what discarding the whole draft does not give you. A language the draft added, and a template that has never been submitted, have nothing to restore and are refused. Pass revision to make the discard a compare-and-set against the copy you read; omit it and the discard is last-write-wins, the same rule this language's PUT follows. Nothing reaches WhatsApp until the draft is submitted.
Parameters
template_refstringThe template: its id (wat_…) or its slug. A value that parses as a wat_ id is treated as one; anything else is a slug. Slugs on this channel can spell a typed id, so the two are told apart by parsing the value rather than by its character set.
version_idstringVersion ID.
languagestringThe language, as a BCP-47 tag. Case and separator variance is accepted and normalised, and the canonical form is returned.
Request Payload
revisionThe revision you last read for this language, making the discard a compare-and-set: a mismatch is refused with a conflict, leaving an edit you have not seen in place. Omit it for last-write-wins, which is what a single writer wants. Supplying it for a language the draft no longer holds is also refused with a conflict rather than recreating the language.
Response Payload
languageThe canonical form of the tag you addressed. Use it in later calls for this language.
revisionThe language's new revision, to pass back on your next write.
content_hashA hash over the content as saved, so you can tell whether your next write would change anything without diffing the document.
updated_atWhen this language was last written.
Related resources
Continue with the documentation, guides and examples for this topic.