SMS Integration :
For my project, I integrated this service for Mobile number Verification. In desinged module user can verify his mobile no by verification code. I got Paid service to send SMS from my application(service provider www.znisms.com)
Required Parameters to integrate this service are:
1 – userId
2-API key
3-senderID
4-sendto
5-message In that first
3 parameters will get from service provider..
After that, In an action you have to create url with this parameters & related values
like ## /controller/profiles_controller.rb
def send_sms
@receiver = params[:users][:reciever]
@msg = params[:users][:message]
@mu_sms_url = "http://api.znisms.com/post/smsv3.asp? userid=GaneshK&apikey=xxx&message=#{@msg}& senderid=9123123456&sendto=#{@receiver}"
Kernal.open(@mu_sms_url) do |f|
@result = f.write
end
flash[:notice] = @result
redirect_to @user
end
So, by using above code you can send request, Purpose behind this API key is unique key, and that is used to validate authorized request access.
Hope this code will help for your application.
Regards,
-Ganesh Kathare.
Advertisement
