4
5
6
7
8
9
10
11
12
13
14
|
# File 'lib/msg91/message.rb', line 4
def self.send_text(sender_id,route,country,recepients,text)
auth_key = Msg91.configuration.auth_key
url = URI("http://api.msg91.com/")
http = Net::HTTP.new(url.host, url.port)
path = '/api/v2/sendsms'
= {'authkey' => auth_key,'Content-Type' => 'application/json','unicode' => '1'}
body_json = build_json(sender_id,route,text,recepients,country)
response = http.post(path,body_json,)
parsed_response = JSON.parse(response.read_body)
return parsed_response
end
|