SMSGateway.me message object to create, send, find and cancel messages from your application.
Name | Type | description |
---|---|---|
id | int | Unique ID of SMS |
device_id | string | Device ID from which SMS will be sent. |
phone_number | string | Phone number to which SMS will be sent. |
message | string | SMS contents |
status | string | current status of SMS |
created_at | string | Time at which request was sent to server |
updated_at | string | Last updated timestamp |
log | array | Complete history of this SMS lifecycle |
.send
.cancel
.new
.all
.where
.find
Gem is written to follow ActiveRecord
way so in order to query objects on server, same practices will be followed:
sms = SMSGateway::Message.new(from_device_id, to_phone_number, sms_text)
sms.send
sms = SMSGateway::Message.find(message_id)
sms = SMSGateway::Message.find(message_id)
sms.cancel
all_sms = SMSGateway::Message.all
all_sms = SMSGateway::Message.where("device_id = '1234' AND message = 'Hello, World!'")