Class: Whatsapp::SubscribedApp::Unsubscribe

Inherits:
Object
  • Object
show all
Extended by:
ResponseHandling, Transport
Defined in:
lib/ruby/whatsapp/subscribed_app/unsubscribe.rb

Overview

Unsubscribes this app from a WABA's webhook notifications. All webhook deliveries for that WABA stop immediately. 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) ⇒ Response::Unsubscription

Parameters:

  • client (Whatsapp::Client) (defaults to: Client.new)

    The WhatsApp client instance.

Returns:

Raises:

  • (Error)

    if no WABA ID is configured, or the request fails.



16
17
18
19
20
21
22
# File 'lib/ruby/whatsapp/subscribed_app/unsubscribe.rb', line 16

def call(client: Client.new)
  response = client.connection.delete(edge_path(client))

  Response::Unsubscription.deserialize(
    parse_json(handle_response!(response, error_class: Error, action: "unsubscribe app"))
  )
end