Thursday, 28 June 2018

SMS integration using msg91 in ruby

require 'uri'
require 'net/http'

PARAMS

sender = 'RAJKMAR'
route = 4
mobiles = '91********'
authkey = '**********'
message = 'Your message'
country = '91'

API CALL:

url = URI("http://api.msg91.com/api/sendhttp.php?sender=#{sender}&route=#{route}&mobiles=#{mobiles}&authkey=#{authkey}&encrypt=&country=#{country}&message=#{message}")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)

No comments:

Post a Comment

Interactor in Rails

What is interactor? Interactor provides a common interface for performing complex user interactions An interactor is a simple, sin...