Sha256: b9897e5f975dfe704b177bd36bb83e1cfa2b2d7ca7d25a7cab14a925fe893a8d

Contents?: true

Size: 894 Bytes

Versions: 2

Compression:

Stored size: 894 Bytes

Contents

module Twilio
    # 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.
  class Sms < TwilioObject
    #  Example:
    #  Twilio.connect('my_twilio_sid', 'my_auth_token')
    #  Twilio::Sms.message(CALLER_ID, user_number, 'This is my simple SMS message', 'http://example.com/sms_callback')
    def message(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

    def list(optional = {})
      Twilio.get("/SMS/Messages", :query => optional)
    end

    def get(sms_message_sid)
      Twilio.get("/SMS/Messages/#{sms_message_sid}")
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twilio-2.9.0 lib/twilio/sms.rb
twilio-2.8.0 lib/twilio/sms.rb