Get a Free WhatsApp Business Account – Includes Onboarding, API Access & Sandbox. Apply Now!


Sample Code For Send SMS in Ruby

Sending SMS using Authkey APIs is a breeze and lightning fast. You can simply pass the message body, message sender, mobile number & authkey in the API request to send sms instantly.

Ruby Sample Code For Send SMS



require 'uri'
require 'net/http'

url = URI("https://api.authkey.io/request?authkey=AUTHKEY&mobile=RecepientMobile&
country_code=CountryCode&sms=Hello%2C%20your%20OTP%20is%201234&sender=SENDERID")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

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

response = http.request(request)
puts response.read_body

Sending SMS using Authkey APIs is a breeze and lightning fast. You can simply pass the message body, message sender, mobile number & authkey in the API request to send sms instantly.