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, or add keywords of your own. Your rule takes precedence over Bird's at the same grain and keeps Bird's keywords unless you add more. 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
| Name | Description |
|---|---|
| --body-file | Read the JSON request body from this file; "-" reads stdin |
| --example | Print a complete example request body, then exit |
| --dry-run | Print the resolved request without sending it, then exit |
| --idempotency-key | Deduplication key; a retry with the same key won't act twice |
Options
| Name | Description |
|---|---|
| --operation | What 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) |
| --country | The 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. |
| --waba | Limit 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. You cannot remove one of Bird's keywords, and a keyword Bird has bound to the other operation cannot be reused here. |
| --reply | The message to send back when a keyword matches. Omit it to send nothing. |
| --response-schema | Print the fields this command returns, then exit |
Related
| Name | Description |
|---|---|
| bird whatsapp keyword-rules delete | Delete a WhatsApp keyword rule |
| bird whatsapp keyword-rules get | Get a WhatsApp keyword rule |
| bird whatsapp keyword-rules list | List WhatsApp keyword rules |
| bird whatsapp keyword-rules update | Update a WhatsApp keyword rule |
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