Flexibility and convenience
Newaccount_sid auth_token Send and receive SMS Send SMS Sending SMS using the Twilio Ruby client is very simple. Here is the sample code for sending SMS ruby message client.messages.create body Hello this is a text message from Twilio from your Twilio phone number to recipient phone number puts message.sid Receive SMS To receive SMS you need to set up a webhook to
The handle the HTTP request
sent by Twilio. Configure the callback URL for messages in the Twilio console then set up a route in your app to handle these requests Spam Number for example using Sinatra ruby require sinatra require twilioruby post sms do response Twilio TwiML Messaging Response.new do.message body.
Thank you for your message
end content_type textxml response.to_xml end Make and receive voice calls Make a voice call Here is sample code for making a voice call Canada Phone Number using the Twilio Ruby client ruby call client.calls.create url httpyour app addresstwiml to recipient phone number from your Twilio phone number puts call.sid Handling a Voice Call Handling a voice call also requires setting up a webhook.