module SmsApi
TODO
Constants
- VERSION
Public Class Methods
sms(to, text, from = 'Eco')
click to toggle source
Method to send SMS For 'Eco' messages you should pass only msisdn and message For Pro message you should set third argument 'from' usage: SmsApi.sms
('MSISDN','message', 'from') 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
# File lib/sms_api.rb, line 24 def self.sms(to, text, from = 'Eco') test = ENV['SMSAPI_TEST'] || 0 get('/sms.do', query: { to: to, test: test, message: text, from: from }) end
status()
click to toggle source
Method will give count avaliable count/messages on account In case you need specified value you can use as follows: SmsApi.status['points']
- for points count SmsApi.status['proCount']
- for pro messages count SmsApi.status['ecoCount']
- for default messages count SmsApi.status['mmsCount']
- for MMS count
# File lib/sms_api.rb, line 36 def self.status get('/user.do', query: { credits: 1, details: 1 }) end