Create a WhatsApp suppression
POST
/v1/whatsapp/suppressions
// Omit waba to block the address for the whole workspace, whichever account
// sends. With it, your other accounts keep reaching them, and the same
// address for two accounts is two records.
const suppression = await bird.whatsapp.suppressions.add({
address: "+15550001234",
waba: "102290129340398",
});
console.log(suppression.id, suppression.applies_to);# Omit waba to block the address for the whole workspace, whichever account
# sends. With it, your other accounts keep reaching them, and the same
# address for two accounts is two records.
suppression = client.whatsapp.suppressions.add(
address="+15550001234",
waba="102290129340398",
)
print(suppression.id, suppression.applies_to)suppression, err := client.Whatsapp.Suppressions.Add(context.Background(), bird.WhatsappSuppressionsAddParams{
Address: "+15550001234",
// Omit Waba to block the address for the whole workspace, whichever account
// sends. With it, your other accounts keep reaching them, and the same
// address for two accounts is two records.
Waba: &waba,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(suppression.Id, suppression.AppliesTo)// Omit setWaba to block the address for the whole workspace, whichever account
// sends. With it, your other accounts keep reaching them, and the same address
// for two accounts is two records.
$suppression = $bird->whatsapp->suppressions->add(
(new WhatsAppSuppressionCreate())
->setAddress('+15550001234')
->setWaba('102290129340398'),
);
echo $suppression->getId(), ' ', $suppression->getAppliesTo();bird whatsapp suppressions add --address +5511977670804curl -X POST "https://us1.platform.bird.com/v1/whatsapp/suppressions" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"address": "+5511977670804"
}'Réponse200
{
"id": "was_01krdgeqcxet5s7t44vh8rt9mg",
"address": "+5511977670804",
"waba": null,
"reason": "manual",
"origin": "api_key",
"applies_to": "all",
"source_whatsapp_id": "wam_01krdgeqcxet5s7t44vh8rt9mg",
"ended_reason": "api_key"
}
Manually adds a WhatsApp address to the suppression list with reason manual. If the address is already suppressed, the API returns 200 with the existing record.
Corps de la requête
address
string
obligatoire
WhatsApp address to suppress. For a phone number, supply canonical E.164 with a leading plus sign, such as +5511977670804. A value that is not a valid phone number returns a 422.
waba
string
Limit the suppression to messages sent from this WhatsApp Business Account, identified by its WhatsApp-issued account ID. Omit it to block the address for the whole workspace, whichever account sends.
Contenu de la réponse
id
string
obligatoire
Unique identifier for the suppression record.
address
string
obligatoire
The suppressed WhatsApp address. For a phone number this is canonical E.164 with a leading plus sign, such as +5511977670804.
waba
nullable string
The WhatsApp Business Account the suppression is limited to, identified by its WhatsApp-issued account ID, or null when it covers the whole workspace.
reason
string
obligatoire
Why the address is suppressed. manual means it was added directly rather than created automatically from a delivery outcome. This list grows over time, so treat an unknown value as informational rather than rejecting the record.
Possible values (may grow over time): manual
origin
string
obligatoire
How the suppression came to exist: api_key (added through the API with an API key) or user (added by a user in the dashboard). This list grows over time, so treat an unknown value as informational rather than rejecting the record.
Possible values (may grow over time): api_key, user
applies_to
string
obligatoire
Blocking policy. all blocks every message category. Treat an unrecognized value as blocking.
Possible values (may grow over time): all
source_whatsapp_id
string
ID of the WhatsApp message that caused this address to be suppressed, when the suppression was created automatically. Omitted for addresses added manually.
ended_at
nullable string
When this stopped applying. Null while it is still stopping messages, which is the case for every record in the list.
ended_reason
nullable string
What ended it: api_key (deleted through the API with an API key) or user (deleted by a user in the dashboard). Null while it is still stopping messages. This list grows over time, so treat an unknown value as informational rather than rejecting the record.
Possible values (may grow over time): api_key, user
created_at
string
obligatoire
When the suppression was created.
Ressources associées
Poursuivez avec la documentation, les guides et les exemples sur ce sujet. Les ressources sont en anglais.
Comprendre le conceptShould I use a Bird SDK or call the API directly?Suivre le parcours d'apprentissageBuild your first integrationGuide d'implémentationSend your first email
Obtenir un guide d'implémentation