RoR sms api integration

Posted: December 24, 2010 in Ruby On Rails
Tags: , ,

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s