Get a WhatsApp suppression
/v1/whatsapp/suppressions/{suppression_id}// Resolves a record that has already ended, which the list leaves out.
const suppression = await bird.whatsapp.suppressions.get("was_01krdgeqcxet5s7t44vh8rt9mg");
console.log(suppression.reason, suppression.ended_at ?? "still in force");# Resolves a record that has already ended, which the list leaves out.
suppression = client.whatsapp.suppressions.get("was_01krdgeqcxet5s7t44vh8rt9mg")
print(suppression.reason, suppression.ended_at or "still in force")suppression, err := client.Whatsapp.Suppressions.Get(context.Background(), "was_01krdgeqcxet5s7t44vh8rt9mg")
if err != nil {
log.Fatal(err)
}
fmt.Println(suppression.Reason, suppression.EndedAt)// Resolves a record that has already ended, which the list leaves out.
$suppression = $bird->whatsapp->suppressions->get('was_01krdgeqcxet5s7t44vh8rt9mg');
echo $suppression->getReason(), ' ', $suppression->getEndedAt()?->format(DATE_ATOM) ?? 'still in force';bird whatsapp suppressions get <suppression-id>curl -X GET "https://us1.platform.bird.com/v1/whatsapp/suppressions/{suppression_id}" \
-H "Authorization: Bearer $TOKEN"{
"id": "was_01krdgeqcxet5s7t44vh8rt9mg",
"address": "+5511977670804",
"waba": null,
"reason": "manual",
"origin": "user",
"applies_to": "all",
"source_whatsapp_id": "wam_01krdgeqcxet5s7t44vh8rt9mg",
"ended_reason": "api_key"
}
Returns the suppression record for the given ID, including one that has already ended. An ended record keeps its dates and reports when and how it ended.
Parametry
suppression_idstringID of the WhatsApp suppression record to retrieve or end.
Treść odpowiedzi
idUnique identifier for the suppression record.
addressThe suppressed WhatsApp address. For a phone number this is canonical E.164 with a leading plus sign, such as +5511977670804.
wabaThe WhatsApp Business Account this stops, identified by its WhatsApp-issued account ID. Null when it stops the address for every account in the workspace, whichever one sends.
reasonWhy the address cannot be messaged:
manual: Your workspace added the suppression through the API or the dashboard, and can end it.
Possible values (may grow over time): manual
originHow the suppression came to exist:
api_key: an API call.user: someone acting in the dashboard.
Kept beside the reason because one reason can arrive by more than one route.
Possible values (may grow over time): api_key, user
applies_toMessage categories blocked for this address. all blocks every category, including authentication and transactional messages, and is the only value in use. Treat unrecognized values as blocking every category.
Possible values (may grow over time): all
blockingWhether this is stopping messages right now. Always true in a list, which carries only the suppressions in force; false when you fetch one by ID that has since ended, which is also when ended_at is set.
source_whatsapp_idThe WhatsApp message a suppression was opened from. Null for a manual suppression, and Bird records no other kind today, so this is null on every record.
effective_atWhen the suppression took effect. For one added through the API or the dashboard this is when it was added, so it matches created_at. This is what orders the list.
ended_atWhen this stopped applying. Null while it is still stopping messages.
ended_reasonWhat ended it:
api_key: an API call.user: someone acting in the dashboard.
Null while the suppression is still stopping messages.
Possible values (may grow over time): api_key, user
ended_effective_atWhen the end took effect. For one ended through the API or the dashboard this matches ended_at. Null while it is still stopping messages.
created_atWhen we recorded it.
last_asserted_atWhen we last recorded this suppression being stated. Later than created_at when your workspace added it again while it was already in force; a repeat adds no new record.
Powiązane zasoby
Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.