fix(wuzapi): use PascalCase keys and All events for webhook config

This commit is contained in:
Rodrigo Borba 2026-01-03 17:40:18 -03:00
parent 39189e2e42
commit 9cf411cc3f

View File

@ -61,8 +61,8 @@ module Wuzapi
end end
def set_webhook(user_token, webhook_url) def set_webhook(user_token, webhook_url)
# Wuzapi expects key 'webhook' per documentation. # Wuzapi expects PascalCase keys 'WebhookURL' and 'Events' with 'All' per user verification.
payload = { 'webhook' => webhook_url, 'events' => %w[Message ReadReceipt Presence HistorySync ChatPresence] } payload = { 'WebhookURL' => webhook_url, 'Events' => ['All'] }
request(:post, '/webhook', payload, user_auth_headers(user_token)) request(:post, '/webhook', payload, user_auth_headers(user_token))
end end