Webhooks 擁有頂層陣列欄位,用以指明所傳達的內容。陣列由 JSON 物件組成,其中包括與 Webhook 相關的詳細欄位。
WhatsApp Business 管理 API Webhooks 可以包含以下物件:
entry
物件參數 | 說明 |
---|---|
| 此 Webhook 所屬的 WhatsApp Business 帳戶編號。 |
| entry 物件的時間。 |
| 觸發 Webhooks 呼叫的變更,詳見 |
changes
參數 | 說明(點擊左欄的箭咀以了解支援的值。) |
---|---|
| 包含您將在此 Webhook 中收到的通知類型。 |
| 包含指定 |
value
參數 | 說明(點擊左欄的箭咀以了解支援的值。) |
---|---|
| 在帳戶被封鎖時加到 Webhooks。此物件包含 2 個屬性:
|
| 包含此帳戶目前的級別限制。 |
| 在作出了有關帳戶或電話號碼的決定時使用。 |
| 包括觸發相應通知的商業帳戶顯示電話號碼。 |
| 在指定 WhatsApp Business 帳戶發生事件時使用。點擊左欄的箭咀以查看所有可用選項。 |
|
表示您可使用 WhatsApp Business 帳戶的每個具獲核准顯示名稱的企業電話號碼所傳送的範本訊息數量。查看收發訊息限制。 |
| 包括一個商家可擁有的電話號碼數量上限。 field=business_capability_update 時,Webhook 將有 max_phone_numbers_per_business 或 max_phone_numbers_per_waba。 |
| 包括一個 WhatsApp Business 帳戶可擁有的電話號碼數量上限。 field=business_capability_update 時,Webhook 將有 max_phone_numbers_per_business 或 max_phone_numbers_per_waba。 |
| 範本被拒原因。可能的值:
|
| 如果要求遭拒,此欄位會顯示拒絕原因。 |
| 此欄位顯示傳送以供驗證的名稱。 |
列舉 | 在特定 WhatsApp Business 帳戶因違反 WhatsApp Business 平台政策時而被施加限制時,回報有關限制。 此欄位包括限制類型清單及其相應的到期日。可能的限制類型包括:
到期日以 DateTime 格式提供。 |
| 已要求停用或者已停用/已更新雙重認證驗證碼的用戶之編號。 |
{ "object": "whatsapp_business_account", "entry": [ { "id": "whatsapp-business-account-id", "time": 1604703141, "changes": [ { "field": "message_template_status_update", "value": { "event": "APPROVED", "message_template_id": 1234567, "message_template_name": "My message template", "message_template_language": "en-US", "reason": null } } ] } ] }
{ "object": "whatsapp_business_account" "entry": [ { "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>", "time": <TIMESTAMP>, "changes": [ { "value": { "event": "REJECTED", "message_template_id": <TEMPLATE_ID>, "message_template_name": "<TEMPLATE_NAME>", "message_template_language": "<LANGUAGE_AND_LOCALE_CODE>", "reason": "<REJECTION_REASON>" }, "field": "message_template_status_update" } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "WHATSAPP-BUSINESS-ACCOUNT-ID", "time": TIMESTAMP, "changes": [ { "field": "message_template_status_update", "value": { "event": "FLAGGED", "message_template_id": TEMPLATE-ID, "message_template_name": "My message template", "message_template_language": "en-US", "reason": null, "disable_info": { "disable_date": "DATE", } } } ] } ] }
{ "object": "whatsapp_business account", "entry": [ { "id": "10908...", "time": 1661885238, "changes": [ { "value": { "event": "PAUSED", "message_template_id": 6048..., "message_template_name": "welcome", "message_template_language": "en_US", "reason": "NONE", "other_info": { "title": "SECOND_PAUSE", "description": "Your WhatsApp message template has been paused for 6 hours until Aug 31 at 12:47 AM UTC because it continued to have issues." } }, "field": "message_template_status_update" } ] } ], }
{ "object": "whatsapp_business account", "entry": [ { "id": "10310...", "time": TIMESTAMP, "changes": [ { "value": { "event": "PENDING_DELETION", "message_template_id": 1137..., "message_template_name": "<MY_TEMPLATE_NAME>", "message_template_language": "en_US", "reason": "NONE" } }, "field": "message_template_status_update" } ] } ], }
{ "object": "whatsapp_business_account", "entry": [ { "id": "<ID>", "time": <TIME>, "changes": [ { "field": "template_category_update", "value": { "message_template_id": <MESSAGE_TEMPLATE_ID>, "message_template_name": "<MESSAGE_TEMPLATE_NAME>", "message_template_language": "<MESSAGE_TEMPLATE_LANGUAGE", "previous_category": "<PREVIOUS_CATEGORY>", "new_category": "<NEW_CATEGORY>" } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>", "time": <TIMESTAMP>, "changes": [ { "field": "message_template_quality_update", "value": { "previous_quality_score": "<PREVIOUS_QUALITY_SCORE>", "new_quality_score": "<NEW_QUALITY_SCORE>", "message_template_id": <TEMPLATE_ID>, "message_template_name": "<TEMPLATE_NAME>", "message_template_language": "<LANGUAGE_AND_LOCALE_CODE>" } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "waba-id", "time": 1608243053, "changes": [ { "field": "phone_number_name_update", "value": { "display_phone_number": "16505551111", "decision": "APPROVED", "requested_verified_name": "WhatsApp", "rejection_reason": null } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "waba-id", "time": 1608243062, "changes": [ { "field": "phone_number_quality_update", "value": { "display_phone_number": "16505551111", "event": "FLAGGED", "current_limit": "TIER_10K" } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "whatsapp-business-account-id", "time": 1604703058, "changes": [ { "field": "account_update", "value": { "phone_number": "16505551111", "event": "VERIFIED_ACCOUNT" } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "whatsapp-business-account-id", "time": 1604703058, "changes": [ { "field": "account_update", "value": { "event": "DISABLED_UPDATE" "ban_info": { "waba_ban_state": ["SCHEDULE_FOR_DISABLE", "DISABLE", "REINSTATE"], "waba_ban_date": "January 31, 2021" } } } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "WHATSAPP-BUSINESS-ACCOUNT-ID", "time": TIMESTAMP, "changes": [ { "value": { "event": "ACCOUNT_VIOLATION", "violation_info": { "violation_type": "VIOLATION_TYPE" } }, "field": "account_update" } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "WHATSAPP-BUSINESS-ACCOUNT-ID", "time": TIMESTAMP, "changes": [ { "value": { "event": "ACCOUNT_RESTRICTION", "restriction_info": [ {"restriction_type": "RESTRICTED_BIZ_INITIATED_MESSAGING" | "RESTRICTION_ON_ADD_PHONE_NUMBER_ACTION" | "RESTRICTED_CUSTOMER_INITIATED_MESSAGING", "expiration": TIMESTAMP} ] } }, "field": "account_update" } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "WHATSAPP-BUSINESS-ACCOUNT-ID", "time": TIMESTAMP, "changes": [ { "value": { "event": "DISABLED_UPDATE", "ban_info": { "waba_ban_state": "SCHEDULE_FOR_DISABLE" | "DISABLE" | "REINSTATE", "waba_ban_date": TIMESTAMP } }, "field": "account_update" } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "whatsapp-business-account-id", "time": 1604703141, "changes": [ { "field": "account_review_update", "value": { "decision": "APPROVED" } } ] } ] }
{ "field": "account_update", "value": { "phone_number": "PHONE_NUMBER", "event": "ACCOUNT_RESTRICTION", "restriction_info": [ { "restriction_type": "RESTRICTION_ADD_PHONE_NUMBER_ACTION", "expiration": TIMESTAMP }, { "restriction_type": "RESTRICTED_BIZ_INITIATED_MESSAGING", "expiration": TIMESTAMP }, { "restriction_type": "RESTRICTED_CUSTOMER_INITIATED_MESSAGING", "expiration": TIMESTAMP } ] } }
{ "object": "whatsapp_business_account", "entry": [ { "id": "WHATSAPP-BUSINESS-ACCOUNT-ID", "time": TIMESTAMP, "changes": [ { "value": { "phone_number": "15551...", "event": "ACCOUNT_DELETED", }, "field": "account_update" } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "WHATSAPP-BUSINESS-ACCOUNT-ID", "time": TIMESTAMP, "changes": [ { "value": { "phone_number": "15551...", "event": "PARTNER_REMOVED", }, "field": "account_update" } ] } ] }
{ "object": "whatsapp_business_account", "entry": [ { "id": "WHATSAPP-BUSINESS-ACCOUNT-ID", "time": TIMESTAMP, "changes": [ { "field": "business_capability_update", "value": { "max_daily_conversation_per_phone": NUMBER, "max_phone_numbers_per_business": NUMBER } } ] } ] }
{ "entry": [ { "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>", "time": <UNIX_TIMESTAMP>, "changes": [ { "value": { "entity_type": "BUSINESS", "entity_id": "<BUSINESS_ID>", "alert_severity": "CRITICAL", "alert_status": "ACTIVE", "alert_type": "INCREASED_CAPABILITIES_ELIGIBILITY_FAILED", "alert_description": "Based on your activity, limits cannot be increased for your business <BUSINES_NAME>. Contact support for more information." }, "field": "account_alerts" } ] } ], "object": "whatsapp_business_account" }
{ "entry": [ { "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>", "time": <UNIX_TIMESTAMP>, "changes": [ { "value": { "entity_type": "BUSINESS", "entity_id": "<BUSINESS_ID>", "alert_severity": "WARNING", "alert_status": "ACTIVE", "alert_type": "INCREASED_CAPABILITIES_ELIGIBILITY_DEFERRED", "alert_description": "Limits cannot be increased for your business <BUSINES_NAME>. Use WhatsApp Business platform actively for several days and follow our messaging policies." }, "field": "account_alerts" } ] } ], "object": "whatsapp_business_account" }
{ "entry": [ { "id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>", "time": <UNIX_TIMESTAMP>, "changes": [ { "value": { "entity_type": "BUSINESS", "entity_id": "<BUSINESS_ID>", "alert_severity": "WARNING", "alert_status": "ACTIVE", "alert_type": "INCREASED_CAPABILITIES_ELIGIBILITY_NEED_MORE_INFO", "alert_description": "Additional verification is required for your business <BUSINESS_NAME>. Go to Security Center in Meta for Business to complete identity verification. To continue without completing additional verification, your business can use WhatsApp Business platform actively for several days and follow our messaging policies." }, "field": "account_alerts" } ] } ], "object": "whatsapp_business_account" }