Validate a broadcast
/v1/email/broadcasts/{broadcast_id}/validateconst params = {
template: {
parameters: {
title: "Welcome",
offer: "OCTOBER20",
discount: 20,
featured: false,
},
},
};
const result = await bird.broadcasts.validate(
"eb_01krdgeqcxet5s7t44vh8rt9mg",
params,
);
console.log(result.ready_for_admission, result.problems);template = {
"parameters": {
"title": "Welcome",
"offer": "OCTOBER20",
"discount": 20,
"featured": False,
}
}
result = client.broadcasts.validate("eb_01krdgeqcxet5s7t44vh8rt9mg", template=template)
print(result.ready_for_admission, result.problems)parameters := map[string]json.RawMessage{"title": json.RawMessage(`"Welcome"`), "offer": json.RawMessage(`"OCTOBER20"`), "discount": json.RawMessage(`20`), "featured": json.RawMessage(`false`)}
params := bird.BroadcastsValidateParams{Template: bird.Value(bird.BroadcastsParameterTemplate{Parameters: ¶meters})}
result, err := client.Broadcasts.Validate(context.Background(), "eb_01krdgeqcxet5s7t44vh8rt9mg", params)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.ReadyForAdmission, result.Problems)$params = ['template' => ['parameters' => ['title' => 'Welcome', 'offer' => 'OCTOBER20', 'discount' => 20, 'featured' => false]]];
$result = $bird->broadcasts->validate('eb_01krdgeqcxet5s7t44vh8rt9mg', $params);
echo json_encode($result->getReadyForAdmission()), json_encode($result->getProblems());bird email broadcasts validate <broadcast-id> --from newsletter@acme.comcurl -X POST "https://us1.platform.bird.com/v1/email/broadcasts/{broadcast_id}/validate" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"from": "newsletter@acme.com"
}'{
"resolution": {
"template_id": "emt_01krdgeqcxet5s7t44vh8rt9mg",
"observed_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
"requested_language": "pt-BR",
"effective_language": "pt-BR",
"default_language": "pt-BR"
},
"problems": [
{
"code": "parameter_required",
"phase": "validation",
"severity": "error",
"pointer": "/template/parameters/first_name",
"site": "subject",
"budget": "output_bytes",
"contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg"
}
]
}
Check the saved broadcast or the changes supplied in this request against the template's published content. This does not save changes, select a template version for sending or evaluate recipients. Requires template read permission in addition to broadcast read. Warnings about the broadcast's automatic seed test also need Inbox Insights read, and a result without them does not confirm that the seed test will run. Each call computes a fresh result. An Idempotency-Key header is accepted but does not replay an earlier result.
Parameters
broadcast_idstringBroadcast identifier.
Request Payload
templateReplaces the template, language or parameters for this request. Null removes the template for this request.
fromReplaces the sender for this request. Give it as a plain address, as Jane <jane@acme.com> to include a display name, or as an object with an address and a name.
reply_toReplaces the reply-to addresses for this request. Null removes them.
headersReplaces the custom headers for this request rather than adding to them. Up to 25 of them, each value up to 998 characters. The header rules for updating a broadcast apply.
brand_idChanges the Brand for this validation, preview or test only, without changing the saved broadcast. Null selects the workspace default Brand. Omission keeps a historical broadcast's saved identity. An unavailable saved Brand remains renderable with a brand_unavailable diagnostic. Before sending a test, preview again with an available ID or null, then send the same override and fresh preview_fingerprint. Explicit unavailable overrides return 422.
Response Payload
ready_for_admissionWhether the current template and supplied broadcast inputs pass validation, including checks that the sender, audience and selected Brand can be used. Sending also checks permissions, limits, the audience's recipients and their values, so true does not guarantee the broadcast sends.
resolutionThe published template version and language that were checked. Absent when no published template could be selected.
problemsThe problems found. Problems with severity error block sending, and none remain when ready_for_admission is true. Problems with severity warning do not block sending.
unused_parametersNames supplied in template.parameters, or in the selected language's template.parameter_overrides entry, that the selected content and envelope do not use. Rendering the selected content ignores them. With template.parameter_overrides, this can include a name in base_parameters that only the default language uses, and template.parameters must still hold its value.
base_parametersInput names template.parameters must hold, returned with resolution. Without template.parameter_overrides these are the inputs the selected language uses. With it they are every input the default language's content or the envelope uses, including names the selected language does not use.
override_parametersInput names only the selected language uses, returned with resolution. Each may come from that language's entry in template.parameter_overrides or from template.parameters. Always empty without template.parameter_overrides.
Related resources
Continue with the documentation, guides and examples for this topic.