Class: FreshchatWhatsapp::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/freshchat_whatsapp/api.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_path = nil, token = nil) ⇒ Api

Returns a new instance of Api.



8
9
10
11
12
# File 'lib/freshchat_whatsapp/api.rb', line 8

def initialize(base_path=nil,token=nil)
  fresh_chat_base_path = base_path || FreshchatWhatsapp.configuration.base_path
  @base_path = fresh_chat_base_path
  @token = token
end

Instance Method Details

#check_message_status(request_id) ⇒ Object



26
27
28
29
30
31
# File 'lib/freshchat_whatsapp/api.rb', line 26

def check_message_status(request_id)
  Actions::CheckMessageStatus.new(
    client,
    request_id
  ).call
end

#send_hsm_message(from_number, to_number, namespace, template_name, language, params) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/freshchat_whatsapp/api.rb', line 14

def send_hsm_message(from_number, to_number, namespace, template_name, language, params)
  Actions::SendHsmMessage.new(
    client,
    from_number,
    to_number,
    namespace,
    template_name,
    language,
    params
  ).call
end