Class: Twilio::Sms
- Inherits:
-
TwilioObject
- Object
- TwilioObject
- Twilio::Sms
- Defined in:
- lib/twilio/sms.rb
Overview
An SMS message resource represents an Inbound or Outbound SMS message. When someone sends a text message from or to your application, either via the REST API, or during a call via the verb, an SMS message resource is created.
Instance Method Summary collapse
- #get(sms_message_sid) ⇒ Object
- #list(opts = {}) ⇒ Object
-
#message(from, to, body, callback_url = nil) ⇒ Object
Example: Twilio.connect(‘my_twilio_sid’, ‘my_auth_token’) Twilio::Sms.message(CALLER_ID, user_number, ‘This is my simple SMS message’, ‘example.com/sms_callback’).
Methods inherited from TwilioObject
#connected?, #initialize, method_missing
Constructor Details
This class inherits a constructor from Twilio::TwilioObject
Instance Method Details
#get(sms_message_sid) ⇒ Object
17 18 19 |
# File 'lib/twilio/sms.rb', line 17 def get() Twilio.get("/SMS/Messages/#{}") end |
#list(opts = {}) ⇒ Object
13 14 15 |
# File 'lib/twilio/sms.rb', line 13 def list(opts = {}) Twilio.get("/SMS/Messages", :query => (opts.empty? ? nil : opts)) end |
#message(from, to, body, callback_url = nil) ⇒ Object
8 9 10 11 |
# File 'lib/twilio/sms.rb', line 8 def (from, to, body, callback_url=nil) callback = callback_url ? {:StatusCallback => callback_url} : {} Twilio.post("/SMS/Messages", :body => {:From => from, :To => to, :Body => body}.merge(callback)) end |