Class: Africastalking::Message

Inherits:
Connection show all
Defined in:
lib/africastalking/message.rb

Class Method Summary collapse

Methods inherited from Connection

headers

Class Method Details

.enqueue_message(data) ⇒ Object



17
18
19
# File 'lib/africastalking/message.rb', line 17

def enqueue_message(data)
  post('/version1/messaging', build_enqueued_messages(data))
end

.fetch(last_received_id = 0) ⇒ Object



5
6
7
# File 'lib/africastalking/message.rb', line 5

def fetch(last_received_id=0)
  get("/version1/messaging?username=#{Africastalking.config.username}&lastReceivedId=#{last_received_id}")
end

.send(recipients, message) ⇒ Object



9
10
11
# File 'lib/africastalking/message.rb', line 9

def send(recipients, message)
  post('/version1/messaging', build_message(recipients, message))
end

.send_premium(data) ⇒ Object



13
14
15
# File 'lib/africastalking/message.rb', line 13

def send_premium(data)
  post('/version1/messaging', build_premium_messages(data))
end