Sign inGet Started

bird whatsapp keyword-rules create

Usage

Exemple de code
bird whatsapp keyword-rules create [flags]

Description

Create a WhatsApp keyword rule

Replace the reply Bird sends for opt-out or opt-in, add keywords of your own, or remove some of Bird's with excluded_keywords. Your rule takes precedence over Bird's at the same grain and keeps Bird's keywords unless you exclude them. A keyword Bird has bound to one operation cannot be reused for the other.

Build the request from flags, a JSON WhatsAppKeywordRuleCreate body via --body-file ("-" reads stdin), or both — a flag overrides the matching body field. Run --example to print a ready-to-edit body, or --dry-run to print the resolved request without sending it.

Examples

Exemple de code
# print the body shape (no credentials needed)
bird whatsapp keyword-rules create --example

# the body it prints:
Exemple de code
{
  "country": "US",
  "keywords": ["no more texts", "remove me"],
  "operation": "opt_out",
  "reply": "You're off the list. ACME Courier won't message you again.",
  "waba": "102290129340398"
}

Options

Request

NameDescription
--body-fileRead the JSON request body from this file; "-" reads stdin
--examplePrint a complete example request body, then exit
--dry-runPrint the resolved request without sending it, then exit
--idempotency-keyDeduplication key; a retry with the same key won't act twice

Options

NameDescription
--operationWhat Bird does when an inbound message matches the rule. - opt_out records that the sender no longer consents to receive any messages from your WhatsApp Business Account, including transactional ones. Typing the word is the person's own statement, so it covers everything, unlike WhatsApp's built-in marketing opt-out control, which stops marketing alone. - opt_in records that they consent again. A rule's operation is fixed once created, and a keyword belongs to exactly one operation, so a keyword Bird ships for opt_out cannot be reused for opt_in. Closed on the write side: an operation Bird does not answer is rejected here rather than stored as a rule that never fires. The read side is open, because Bird can gain an operation without a new API version. Possible values: opt_in, opt_out. (required; or in --body-file)
--countryThe country this rule applies in, as an ISO 3166-1 alpha-2 code. It matches the country of the person who messaged you, worked out from their phone number. Omit it to cover everyone, which is what Bird's own rules do.
--wabaLimit the rule to one WhatsApp Business Account, identified by its WhatsApp-issued account ID or by the waa_ ID Bird gives it. Either form resolves to the same account, and the rule stores and returns the WhatsApp-issued one. Omit it to cover every account in your workspace. The account must be one of yours.
--keywords <value>…Extra keywords to match, on top of the ones Bird already ships for this operation. Omit to keep Bird's keywords and change only the reply, including keywords Bird adds later. Use excluded_keywords to remove one of Bird's. A keyword Bird has bound to the other operation cannot be reused here.
--excluded-keywords <value>…Bird's keywords to remove for the people this rule covers. Rules are tried most specific first: a more specific rule of yours answers before this one, and with neither country nor waba so does Bird's rule for the sender's country. When this rule answers a message that is exactly an excluded keyword, no one is opted in or out, no reply is sent, and no less specific rule acts on it, so you must honour opt-outs it carries yourself. Without a country, the rule inherits Bird's keywords for each sender's country, so an exclusion covers only senders whose set has that keyword. Exclude every one of Bird's keywords to switch them off where this rule answers; a keyword Bird adds later still matches unless it is already excluded. It changes none of your other rules. A keyword cannot be both added and excluded.
--replyThe message to send back when a keyword matches. Omit it to send nothing.
--response-schemaPrint the fields this command returns, then exit
NameDescription
bird whatsapp keyword-rules deleteDelete a WhatsApp keyword rule
bird whatsapp keyword-rules getGet a WhatsApp keyword rule
bird whatsapp keyword-rules listList WhatsApp keyword rules
bird whatsapp keyword-rules updateUpdate a WhatsApp keyword rule

Poursuivez avec la documentation, les guides et les exemples sur ce sujet.