Module: SmsApi
- Includes:
- HTTParty
- Defined in:
- lib/sms_api.rb,
lib/sms_api/version.rb
Constant Summary collapse
- VERSION =
"0.1.1"
Class Method Summary collapse
-
.send(to, text) ⇒ Object
Method to send ECO messages usage: SmsApi.send(‘MSISDN’,‘message’) Some details about response In response you will recive [‘count’] of sended messages, [‘list’] of messages, on list you have some extra data: “id” - message id, You can use it to grab message status, “points” - cost of operation, “error” - error code if will ocure.
-
.status ⇒ Object
Method will give count avaliable count/messages on account In case you need specified value you can use as follows: SmsApi.status - for points count SmsApi.status - for pro messages count SmsApi.status - for default messages count SmsApi.status - for MMS count.
Class Method Details
.send(to, text) ⇒ Object
Method to send ECO messages usage: SmsApi.send(‘MSISDN’,‘message’) Some details about response In response you will recive [‘count’] of sended messages,
- ‘list’
-
of messages, on list you have some extra data:
“id” - message id, You can use it to grab message status, “points” - cost of operation, “error” - error code if will ocure
20 21 22 23 |
# File 'lib/sms_api.rb', line 20 def self.send to, text test = ENV['SMSAPI_TEST'] || 0 get('/sms.do', query: { to: to, test: test, message: text}) end |
.status ⇒ Object
Method will give count avaliable count/messages on account In case you need specified value you can use as follows: SmsApi.status - for points count SmsApi.status - for pro messages count SmsApi.status - for default messages count SmsApi.status - for MMS count
33 34 35 |
# File 'lib/sms_api.rb', line 33 def self.status get('/user.do', query: { credits: 1, details: 1}) end |