सप्रेशन
सप्रेशन एक ऐसा पता है जिस पर आपका वर्कस्पेस संदेश नहीं भेजेगा, और इसे एक स्कोप के साथ रिकॉर्ड किया जाता है। Bird किसी सप्रेस्ड पते पर भेजे जाने वाले संदेश को WhatsApp तक पहुँचने से पहले रोक देता है।
सूची के साथ काम करने के लिए Suppressions पेज खोलें, या नीचे दिए गए API का उपयोग करें। प्राप्तकर्ता द्वारा बताए गए रिकॉर्ड उसी पेज के Preferences टैब पर होते हैं और अलग नियमों का पालन करते हैं।

किसी बिज़नेस अकाउंट को सप्रेस करना
Suppressions टैब से, किसी फ़ोन नंबर के लिए सप्रेशन बनाएँ और वह बिज़नेस अकाउंट चुनें जिस पर यह लागू होगा। Bird उस अकाउंट से संदेश रोक देता है, और आपके बाकी अकाउंट अभी भी उस नंबर पर संदेश भेज सकते हैं। सूची का Business account कॉलम उस अकाउंट का नाम दिखाता है जिसके लिए सप्रेशन स्कोप्ड है, या पूरे वर्कस्पेस को कवर करने वाले सप्रेशन के लिए All accounts दिखाता है।
POST /v1/whatsapp/suppressions कोड से यही काम करता है। waba वह अकाउंट है जिसके लिए इसे स्कोप करना है; अपने पूरे वर्कस्पेस के लिए पता ब्लॉक करने के लिए इसे छोड़ दें, जिसमें बाद में जोड़े गए अकाउंट भी शामिल हैं:
// 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 $BIRD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"address":"+15550001234","waba":"102290129340398"}'
एक स्कोप, एक रिकॉर्ड
एक सप्रेशन में एक ही स्कोप होता है, इसलिए एक ही पता दो अकाउंट के लिए ब्लॉक करने पर एक नहीं बल्कि दो रिकॉर्ड बनते हैं। पूरे वर्कस्पेस को कवर करने के लिए बिना waba के एक कॉल करें।
जो पता उस स्कोप के लिए पहले से सप्रेस्ड है, उसे जोड़ने पर दूसरा रिकॉर्ड बनाने के बजाय मौजूदा रिकॉर्ड के साथ 200 लौटता है। नया रिकॉर्ड 201 लौटाता है।
सप्रेशन उस पते पर आधारित होता है जो आप रिकॉर्ड करते हैं। फ़ोन नंबर से पहुँचा गया प्राप्तकर्ता और बिज़नेस-स्कोप्ड यूज़र ID से पहुँचा गया वही प्राप्तकर्ता दो अलग कीज़ हैं, इसलिए एक को सप्रेस करने से दूसरा सप्रेस नहीं होता। अगर आप एक ही व्यक्ति को दोनों तरीकों से संबोधित करते हैं तो दोनों रिकॉर्ड करें।
अपनी सप्रेशन सूची पढ़ना
GET /v1/whatsapp/suppressions लागू सप्रेशन लौटाता है, नवीनतम पहले, कर्सर पेज के रूप में। address प्रीफ़िक्स के आधार पर फ़िल्टर करता है और केस को नज़रअंदाज़ करता है: आंशिक मान उसके अंतर्गत आने वाले हर पते से मैच करता है, और पूर्ण मान केवल उसी पते से मैच करता है। reason किसी श्रेणी तक सीमित करता है, जैसे आपके द्वारा जोड़े गए सप्रेशन के लिए manual:
// address is a prefix, so a partial value matches every address under it.
const suppressions = await bird.whatsapp.suppressions.list({ address: "+1555" });
for (const suppression of suppressions.data ?? []) {
console.log(suppression.address, suppression.waba ?? "every account");
}# address is a prefix, so a partial value matches every address under it.
suppressions = client.whatsapp.suppressions.list(address="+1555")
for suppression in suppressions.data or []:
print(suppression.address, suppression.waba or "every account")for suppression, err := range client.Whatsapp.Suppressions.List(context.Background(), bird.WhatsappSuppressionsListParams{
Address: "+1555", // a prefix, so a partial value matches every address under it
}) {
if err != nil {
log.Fatal(err)
}
fmt.Println(suppression.Address, suppression.Reason)
}// address is a prefix, so a partial value matches every address under it.
foreach ($bird->whatsapp->suppressions->list(['address' => '+1555']) as $suppression) {
echo $suppression->getAddress(), ' ', $suppression->getWaba() ?? 'every account', PHP_EOL;
}bird whatsapp suppressions listcurl "https://us1.platform.bird.com/v1/whatsapp/suppressions?address=%2B1555" \
-H "Authorization: Bearer $BIRD_API_KEY"सूची में केवल लागू रिकॉर्ड होते हैं, और समाप्त हो चुके रिकॉर्ड शामिल नहीं होते। किसी पते का न होना यह साबित नहीं करता कि वर्कस्पेस ने उसे कभी सप्रेस नहीं किया; रिकॉर्ड समाप्त हो चुका हो सकता है। पुष्टि के लिए उसे ID से पढ़ें।
एक रिकॉर्ड पढ़ना
GET /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 https://us1.platform.bird.com/v1/whatsapp/suppressions/was_01krdgeqcxet5s7t44vh8rt9mg \
-H "Authorization: Bearer $BIRD_API_KEY"सप्रेशन समाप्त करना
सप्रेशन पंक्ति पर Delete कार्रवाई सप्रेशन को हटाने के बजाय समाप्त करती है। ब्लॉक रुक जाता है। रिकॉर्ड पढ़ने योग्य रहता है और दिखाता है कि वह कब और किसने समाप्त किया। DELETE /v1/whatsapp/suppressions/{suppression_id} भी यही करता है और 204 लौटाता है:
// Only a manual suppression can be ended; a recipient's own opt-out is
// theirs to reverse. The record is kept and still reads back by id.
await bird.whatsapp.suppressions.remove("was_01krdgeqcxet5s7t44vh8rt9mg");# Only a manual suppression can be ended; a recipient's own opt-out is
# theirs to reverse. The record is kept and still reads back by id.
client.whatsapp.suppressions.remove("was_01krdgeqcxet5s7t44vh8rt9mg")if err := client.Whatsapp.Suppressions.Remove(context.Background(), "was_01krdgeqcxet5s7t44vh8rt9mg"); err != nil {
log.Fatal(err)
}// Only a manual suppression can be ended; a recipient's own opt-out is theirs
// to reverse. The record is kept and still reads back by id.
$bird->whatsapp->suppressions->remove('was_01krdgeqcxet5s7t44vh8rt9mg');bird whatsapp suppressions remove <suppression-id> --yescurl -X DELETE https://us1.platform.bird.com/v1/whatsapp/suppressions/was_01krdgeqcxet5s7t44vh8rt9mg \
-H "Authorization: Bearer $BIRD_API_KEY"आपके द्वारा खुद जोड़ा गया सप्रेशन कारण manual रखता है और इसे समाप्त किया जा सकता है। प्राप्तकर्ता का अपना ऑप्ट-आउट उन्हीं के द्वारा पलटा जा सकता है, और यह प्रयास 422 लौटाता है। पहले से समाप्त हो चुके सप्रेशन पर इसे दोबारा कॉल करने पर सफल होता है और कुछ नहीं बदलता, और जो ID वर्कस्पेस में नहीं है वह 404 लौटाती है।
सप्रेशन समाप्त करने के लिए उसकी ID चाहिए, इसलिए पहले सूची से उसे खोजें।
नए सप्रेशन पर नज़र रखना
whatsapp_suppression.created किसी सप्रेशन के रिकॉर्ड होने पर ट्रिगर होता है, ताकि आपका सिस्टम पोलिंग के बिना नए ब्लॉक देख सके। इसका पेलोड इन चीज़ों को रखता है:
- suppression_id, रिकॉर्ड का पहचानकर्ता।
- address, E.164 फ़ॉर्मेट में सप्रेस्ड नंबर।
- waba, वह अकाउंट जिस तक ब्लॉक सीमित है, या null जब यह पूरे वर्कस्पेस को कवर करता है।
- reason और workspace_id।
सप्रेशन समाप्त होने पर कोई इवेंट ट्रिगर नहीं होता, इसलिए अपने पास रखी कॉपी पर भरोसा करने से पहले सूची दोबारा पढ़ें। पूरे पेलोड के लिए WhatsApp events देखें।
अगले कदम
- Preferences: प्राप्तकर्ता द्वारा बताए गए रिकॉर्ड, और उनमें से कौन से आप पलट सकते हैं।
- WhatsApp events: ब्लॉक किए गए संदेश से उत्पन्न whatsapp.rejected पेलोड।
- WhatsApp संदेश भेजना: सेंड API और इसका असिंक्रोनस डिलीवरी मॉडल।
संबंधित संसाधन
इस विषय के लिए डॉक्यूमेंटेशन, गाइड और उदाहरणों के साथ आगे बढ़ें। संसाधन अंग्रेज़ी में हैं।
गाइड देखेंConnecting WhatsApp to Bird: from buying a number to a live channelकॉन्सेप्ट समझेंWhat is the 24-hour customer service window on WhatsApp?टूल का उपयोग करेंWhatsApp message builderक्षमता जानेंWhatsApp
अभ्यास करें और इम्प्लीमेंटेशन ब्रीफ़ पाएँ