fix(wuzapi): use PascalCase keys and All events for webhook config
This commit is contained in:
parent
39189e2e42
commit
9cf411cc3f
@ -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
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user