Komponen Webhooks

Webhooks memiliki kolom array level atas yang menunjukkan apa yang sedang dikomunikasikan. Anggota array adalah objek JSON dengan kolom mendetail yang relevan dengan Webhooks.

Webhooks API Pengelolaan WhatsApp Business dapat berisi objek berikut:

ParameterDeskripsi

object

Ini adalah objek langganan.


Untuk pendaftaran tersemat, ini selalu berupa whatsapp_business_account.

entry

Objek ini berisi detail perubahan yang memicu panggilan Webhooks.

Objek entry

ParameterDeskripsi

id

ID Akun WhatsApp Business yang memiliki Webhooks ini.

time

Waktu entri.

changes

Perubahan yang memicu panggilan Webhooks — lihat objek changes.

changes

ParameterDeskripsi (Klik panah di kolom kiri untuk opsi yang didukung.)

field

Berisi jenis notifikasi yang Anda dapatkan atas Webhooks tersebut.

Nilai yang Didukung

  • account_alerts
  • account_review_update
  • account_update
  • business_capability_update
  • message_template_quality_update
  • message_template_status_update
  • phone_number_name_update
  • phone_number_quality_update
  • security
  • template_category_update

value

Berisi detail perubahan terkait field tertentu — lihat objek value.

value

ParameterDeskripsi (Klik panah di kolom kiri untuk nilai yang didukung.)

ban_info

Ditambahkan ke Webhooks ketika akun telah diblokir. Objek ini menyertakan dua properti:

  • waba_ban_state: Opsinya adalah:
    • DISABLE
    • REINSTATE
    • SCHEDULE_FOR_DISABLE
  • waba_ban_date

current_limit

Berisi batas tingkat saat ini tempat akun ini berada.

Nilai yang Didukung

  • TIER_50
  • TIER_250
  • TIER_1K
  • TIER_10K
  • TIER_100K
  • TIER_UNLIMITED

decision

Digunakan jika keputusan tentang akun atau nomor telepon telah dibuat.

Nilai yang Didukung

  • APPROVED
  • REJECTED

display_phone_number

Termasuk nomor telepon tampilan dari akun bisnis yang memicu notifikasi.

event

Digunakan ketika suatu peristiwa terjadi di WABA tertentu. Klik panah di kolom kiri untuk melihat semua opsi yang tersedia.

Pembaruan nama tampilan

  • APPROVED: Tinjauan disetujui. Jika bisnis sebelumnya tidak dapat mengunduh sertifikatnya, bisnis itu sekarang seharusnya dapat menggunakan nama tampilannya dengan mengunduh sertifikat.
  • DEFERRED: Tinjauan ditangguhkan dan bisnis dapat menggunakan nama tampilan mereka dengan mengunduh sertifikat.
  • REJECTED: Tinjauan ditolak, dengan diberikan alasan penolakannya. Jika bisnis sebelumnya tidak dapat mengunduh sertifikatnya, bisnis itu perlu mengajukan ulang tinjauan nama tampilan untuk mendapatkan akses ke sertifikat. Jika bisnis sudah menggunakan sertifikatnya, penolakan tinjauan nama tampilan tidak memengaruhi operasinya. Namun, tinjauan tetap diperlukan agar bisnis dapat mengembangkan pesan dan batas akunnya.

Pembaruan kualitas template pesan

Skor kualitas sebelumnya:


  • GREEN
  • RED
  • UNKNOWN
  • YELLOW

Skor kualitas baru:


  • GREEN
  • RED
  • UNKNOWN
  • YELLOW

Pembaruan status template pesan

  • APPROVED
  • DISABLED
  • IN_APPEAL
  • PENDING
  • REINSTATED
  • REJECTED
  • FLAGGED

Pembaruan nomor telepon

  • DOWNGRADE
  • FLAGGED
  • ONBOARDING
  • UNFLAGGED
  • UPGRADE

Pembaruan Kategori Template

Kategori sebelumnya:


  • MARKETING
  • OTP
  • TRANSACTIONAL

Kategori baru:


  • AUTHENTICATION
  • MARKETING
  • UTILITY

Kode verifikasi dua langkah

  • PIN_CHANGED: Kode verifikasi dua langkah diperbarui (Cloud API saja)
  • PIN_RESET_REQUEST: Meminta untuk menonaktifkan kode verifikasi dua langkah
  • PIN_RESET_SUCCESS: Kode verifikasi dua langkah dinonaktifkan

Pembaruan WABA

  • ACCOUNT_RESTRICTION: Digunakan untuk melaporkan bahwa pembatasan telah diberlakukan saat WABA melanggar kebijakan Platform WhatsApp Business.
  • DISABLED_UPDATE
  • VERIFIED_ACCOUNT

max_daily_conversation_per_phone

Selalu ada ketika field=business_capability_update.


Menunjukkan jumlah pesan template yang dapat Anda kirim di setiap nomor telepon bisnis Akun WhatsApp Business yang nama tampilannya telah disetujui. Lihat Batas Berkirim Pesan.

max_phone_numbers_per_business

Termasuk jumlah maksimum nomor telepon yang dapat dimiliki bisnis.


Ketika field=business_capability_update, Webhooks akan memiliki max_phone_numbers_per_business atau max_phone_numbers_per_waba.

max_phone_numbers_per_waba

Termasuk jumlah maksimum nomor telepon yang dapat dimiliki WABA.


Ketika field=business_capability_update, Webhooks akan memiliki max_phone_numbers_per_business atau max_phone_numbers_per_waba.

reason

Alasan penolakan template. Kemungkinan nilai:


  • ABUSIVE_CONTENT — Konten telah ditentukan sebagai penyalahgunaan.
  • INCORRECT_CATEGORY — Kategori telah ditentukan sebagai kesalahan. Lihat Kategori Template.
  • INVALID_FORMAT — Duplikat konten atau contoh yang hilang.
  • NONE — Default, diatur saat template disetujui.
  • SCAM—Konten telah ditentukan sebagai penipuan.

rejection_reason

Jika permintaan ditolak, kolom ini menampilkan alasan penolakan itu.

requested_verified_name

Kolom ini menampilkan nama yang dikirim untuk diverifikasi.

restriction_info

enum

Digunakan untuk melaporkan pembatasan yang dikenakan pada WABA tertentu, ketika WABA tersebut melanggar kebijakan Platform WhatsApp Business.


Kolom ini mencakup daftar jenis pembatasan dan tanggal kedaluwarsa yang sesuai. Jenis pembatasan yang mungkin adalah:


  • RESTRICTED_ADD_PHONE_NUMBER_ACTION
  • RESTRICTED_BIZ_INITIATED_MESSAGING
  • RESTRICTED_CUSTOMER_INITIATED_MESSAGING

Tanggal kedaluwarsa disediakan dalam format DateTime.

requester

ID pengguna yang meminta untuk menonaktifkan, atau telah menonaktifkan atau memperbarui, kode verifikasi dua langkah.

Contoh

Pembaruan Status Template Pesan

Template Disetujui

{
  "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 
         }
       }
      ]
    }
  ]
}

Template Ditolak

{
  "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"
        }
      ]
    }
  ]
}

Template Dijadwalkan untuk Dinonaktifkan

{
  "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",
              }
         }
       }
      ]
    }
  ]
}

Template Dijeda

{
  "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"
        }
      ]
    }
  ],
}

Pesan Template Menunggu Dihapus

{
  "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"
        }
      ]
    }
  ],
}

Pembaruan Kategori Template

Kategori Template Berubah

{
  "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>"
          }
        }
      ]
    }
  ]
}

Pembaruan Kualitas Template Pesan

Peringkat Kualitas Template Berubah

{
  "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>"
          }
        }
      ]
    }
  ]
}

Pembaruan Nomor Telepon

Pembaruan Nama Diterima

{
  "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
          }
        }
      ]
    }
  ]
}

Pembaruan Kualitas Diterima

{
  "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"
          }
        }
      ]
    }
  ]
}

Pembaruan WABA

Nomor Kotak Pasir diperbarui ke Akun Terverifikasi

{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "whatsapp-business-account-id",
      "time": 1604703058,
      "changes": [
        {
          "field": "account_update",
          "value": {
            "phone_number": "16505551111",
            "event": "VERIFIED_ACCOUNT"
          }
        }
      ]
    }
  ]
}

Akun WhatsApp Business Diblokir

{
  "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"
            }
          }
        }
      ]
    }
  ]
}

Akun WhatsApp Business Melanggar Kebijakan

{
  "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"
        }
      ]
    }
  ]
}

Akun WhatsApp Business Dibatasi Setelah Pelanggaran Kebijakan

{
  "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"
        }
      ]
    }
  ]
}

Akun WhatsApp Business Dinonaktifkan

{
  "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"
        }
      ]
    }
  ]
}

Tinjauan Akun WhatsApp Business Selesai

{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "whatsapp-business-account-id",
      "time": 1604703141,
      "changes": [
        {
          "field": "account_review_update",
          "value": {
            "decision": "APPROVED"
          }
        }
      ]
    }
  ]
}

Akun WhatsApp Business Dibatasi Karena Pelanggaran Kebijakan

{
  "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
      }
    ]
  }
}

Akun WhatsApp Business Dihapus

{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "WHATSAPP-BUSINESS-ACCOUNT-ID",
      "time": TIMESTAMP,
      "changes": [
        {
          "value": {
              "phone_number": "15551...",
              "event": "ACCOUNT_DELETED",
           },
          "field": "account_update"
        }
      ]
    }
  ]
}

Akun WhatsApp Business Dihapus dari Mitra

{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "WHATSAPP-BUSINESS-ACCOUNT-ID",
      "time": TIMESTAMP,
      "changes": [
        {
          "value": {
              "phone_number": "15551...",
              "event": "PARTNER_REMOVED",
           },
          "field": "account_update"
        }
      ]
    }
  ]
}

Pembaruan Kemampuan Bisnis

{
    "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
            }
          }
        ]
      }
    ]
  }

Pemberitahuan Akun

Peningkatan batas berkirim pesan ditolak

{
  "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"
}

Peningkatan batas berkirim pesan ditolak, perlu lebih banyak penggunaan

{
  "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"
}

Peningkatan batas berkirim pesan ditolak, perlu info selengkapnya

{
  "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"
}