whatsapp_business_management
.GET
, POST
, and DELETE
calls to /{whats-app-business-account-id}/subscribed_apps
are now subject to Business Use Case Rate Limits.
Follow our Webhooks Getting Started guide to create your endpoint and configure your webhook endpoint. When you configure your endpoint, make sure to choose WhatsApp Business Account
and subscribe to individual WhatsApp Business Account (WABA) fields.
Tên trường | Mô tả |
---|---|
| Hệ thống gửi thông báo cho bạn khi một Tài khoản WhatsApp Business đã được xét duyệt. |
| Hệ thống gửi thông báo cho bạn khi có thay đổi đối với Tài khoản WhatsApp Business của bạn. Thay đổi này có thể bao gồm cập nhật về số điện thoại, lỗi vi phạm chính sách, Tài khoản WhatsApp Business bị cấm, v.v. |
| Hệ thống gửi thông báo cho bạn khi một tính năng được cập nhật. Nội dung thông báo có thể bao gồm thay đổi về số lượng số điện thoại tối đa mà một WABA được phép có hoặc số cuộc trò chuyện trên mỗi số điện thoại. |
| Hệ thống gửi thông báo cho bạn khi mẫu tin nhắn đã được phê duyệt hoặc bị từ chối hay đã bị vô hiệu hóa. |
| Hệ thống gửi thông báo cho bạn khi doanh nghiệp bạn nhận được tin nhắn của khách hàng, khi ban gửi tin nhắn cho khách hàng, khi tin nhắn được gửi thành công cho khách hàng và khi khách hàng đọc tin nhắn của bạn. |
| Hệ thống gửi thông báo cho bạn khi tên liên kết với số điện thoại đã được phê duyệt hoặc bị từ chối. |
| Hệ thống gửi thông báo cho bạn khi có cập nhật về trạng thái liên quan đến chất lượng của một số điện thoại. |
| Hệ thống gửi thông báo cho bạn khi: |
Hãy truy cập Tài liệu tham khảo về Webhooks cho Tài khoản WhatsApp Business để biết thêm thông tin về từng trường phần tải dữ liệu và Tài liệu tham khảo về Webhooks cho API Đám mây của WhatsApp để biết thêm thông tin về các loại thông báo messages
khác nhau mà bạn có thể nhận.
You need to subscribe your app to webhooks on a given WABA. We only send notifications if your webhooks-configured app is subscribed to webhooks on a given WABA, and only if the app has permission to edit that WABA.
To subscribe your app to webhooks on a WABA, send a POST
request to the WABA > Subscribed Apps endpoint.
curl -X POST 'https://graph.facebook.com/<API_VERSION>/<WHATSAPP_BUSINESS_ACCOUNT_ID>/subscribed_apps' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'
Upon success:
{ "success": "true" }
To get a list of apps subscribed to webhooks on a WABA, send a GET
request to the WABA > Subscribed Apps endpoint.
curl 'https://graph.facebook.com/<API_VERSION>/<WHATSAPP_BUSINESS_ACCOUNT_ID>/subscribed_apps' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'
A successful response will list the subscribed apps:
{ "data": [ { "whatsapp_business_api_data": { "link": "<APP_1_URL>", "name": "<APP_1_NAME>", "id": "<APP_1_ID>" } }, { "whatsapp_business_api_data": { "link": "<APP_2_URL>", "name": "<APP_2_NAME>", "id": "<APP_2_ID>" } }, ... ] }
To unsubscribe your app from webhooks on a WABA, send a DELETE
request to the subscribed_apps
endpoint.
curl -X DELETE 'https://graph.facebook.com/<AP_VERSION>/<WHATSAPP_BUSINESS_ACCOUNT_ID>/subscribed_apps' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'
A successful response will read:
{ "success": "true" }
If you don't want to subscribe your app with direct API calls, you can easily do it with Graph API Explorer.
Replace the me?fields=id,name
query with <WHATSAPP_BUSINESS_ACCT_ID>/subscribed_apps
. It will subscribe the app you use to send the POST
request in Graph Explorer.
Your app must have permission to edit the WhatsApp business account in order to successfully subscribe.
Example Webhook payload:
[ { "object": "whatsapp_business_account", "entry": [ { "id": "0", "time": 1602782939, "changes": [ { "field": "phone_number_name_update", "value": { "display_phone_number": "16505551111", "decision": "APPROVED", "requested_verified_name": "WhatsApp", "rejection_reason": null } } ] } ] } ]