Class: Zavudev::Resources::Senders::WhatsappSync

Inherits:
Object
  • Object
show all
Defined in:
lib/zavudev/resources/senders/whatsapp_sync.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ WhatsappSync

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of WhatsappSync.

Parameters:



73
74
75
# File 'lib/zavudev/resources/senders/whatsapp_sync.rb', line 73

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(sender_id, request_options: {}) ⇒ Zavudev::Models::Senders::WhatsappSyncRetrieveResponse

Get the current sync status for a sender’s WhatsApp coexistence account. Only available for senders connected in coexistence mode (WhatsApp Business App + Cloud API).

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
# File 'lib/zavudev/resources/senders/whatsapp_sync.rb', line 19

def retrieve(sender_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/senders/%1$s/whatsapp-sync", sender_id],
    model: Zavudev::Models::Senders::WhatsappSyncRetrieveResponse,
    options: params[:request_options]
  )
end

#start_contacts_sync(sender_id, request_options: {}) ⇒ Zavudev::Models::Senders::WhatsappSyncStartContactsSyncResponse

Initiate contact names sync from the WhatsApp Business App. This imports contact names stored in the app to Zavu. Only available for coexistence accounts with active status.

Parameters:

Returns:

See Also:



40
41
42
43
44
45
46
47
# File 'lib/zavudev/resources/senders/whatsapp_sync.rb', line 40

def start_contacts_sync(sender_id, params = {})
  @client.request(
    method: :post,
    path: ["v1/senders/%1$s/whatsapp-sync/contacts", sender_id],
    model: Zavudev::Models::Senders::WhatsappSyncStartContactsSyncResponse,
    options: params[:request_options]
  )
end

#start_history_sync(sender_id, request_options: {}) ⇒ Zavudev::Models::Senders::WhatsappSyncStartHistorySyncResponse

Initiate message history sync from the WhatsApp Business App. This sends a request to the account owner to approve sharing their conversation history. Only available for coexistence accounts with active status.

Parameters:

Returns:

See Also:



61
62
63
64
65
66
67
68
# File 'lib/zavudev/resources/senders/whatsapp_sync.rb', line 61

def start_history_sync(sender_id, params = {})
  @client.request(
    method: :post,
    path: ["v1/senders/%1$s/whatsapp-sync/history", sender_id],
    model: Zavudev::Models::Senders::WhatsappSyncStartHistorySyncResponse,
    options: params[:request_options]
  )
end