Class: Whatsapp::SubscribedApp::Subscribe
- Inherits:
-
Object
- Object
- Whatsapp::SubscribedApp::Subscribe
- Extended by:
- ResponseHandling, Transport
- Defined in:
- lib/ruby/whatsapp/subscribed_app/subscribe.rb
Overview
Subscribes this app to a WABA's webhook notifications.
override_callback_uri/verify_token are for Tech Providers routing several
WABAs' notifications to different callback URLs instead of the one configured on
the app itself.
Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/reference/whatsapp-business-account/subscribed-apps-api
Constant Summary
Constants included from ResponseHandling
ResponseHandling::MAX_ERROR_BODY
Class Method Summary collapse
Class Method Details
.call(client: Client.new, override_callback_uri: nil, verify_token: nil) ⇒ Response::Subscription
22 23 24 25 26 27 28 29 |
# File 'lib/ruby/whatsapp/subscribed_app/subscribe.rb', line 22 def call(client: Client.new, override_callback_uri: nil, verify_token: nil) body = { override_callback_uri:, verify_token: }.compact response = client.connection.post(edge_path(client), json: body) Response::Subscription.deserialize( parse_json(handle_response!(response, error_class: Error, action: "subscribe app")) ) end |