class Smscountry::Services

Your code goes here…

Attributes

password[RW]
senderid[RW]
username[RW]

Public Class Methods

new(username, password,senderid="SMSCountry") click to toggle source
# File lib/smscountry.rb, line 8
def initialize(username, password,senderid="SMSCountry")
        @username = username
        @password = password
        @senderid = senderid
end

Public Instance Methods

check_account_balance() click to toggle source
# File lib/smscountry.rb, line 20
def check_account_balance
        response = RestClient.get "http://api.smscountry.com/SMSCwebservice_User_GetBal.asp?User=#{@username}&passwd=#{@password}"
        puts response.inspect
end
delete_scheduled_sms(reminder_id) click to toggle source
# File lib/smscountry.rb, line 86
def delete_scheduled_sms(reminder_id)
        response = RestClient.get "http://www.smscountry.com/APIDeleteReminder.asp",
        {
        :params => {
                :User => @username, 
                :passwd => @password,
                :RID => reminder_id
                }
        }
        puts response.inspect
        return response
end
edit_scheduled_sms(reminder_id, options = {}) click to toggle source
# File lib/smscountry.rb, line 46
def  edit_scheduled_sms(reminder_id, options = {})
        params_to_send = {
                 :User => @username, 
                 :passwd => @password,
                 :RID => reminder_id
        }
        options.each do |key, value|
                params_to_send[key] = value
        end

        response = RestClient.get "http://www.smscountry.com/APIEditReminder.asp", 
        {:params => params_to_send }
end
get_bulk_reports(fromdate,todate) click to toggle source
# File lib/smscountry.rb, line 25
def get_bulk_reports(fromdate,todate)
        response = RestClient.get "http://api.smscountry.com/smscwebservices_bulk_reports.aspx?User=#{@username}&passwd=#{@password}&fromdate=#{fromdate}&todate=#{todate}"
        puts response.inspect
end
schedule_bulk_message(message,mobile_nums,meesage_type="N",req_delivery_report="Y",interval=0,schedulerName,scheduledDateTime,systemcurrenttime) click to toggle source
# File lib/smscountry.rb, line 30
def schedule_bulk_message(message,mobile_nums,meesage_type="N",req_delivery_report="Y",interval=0,schedulerName,scheduledDateTime,systemcurrenttime)
        response = RestClient.get "http://www.smscountry.com/APISetReminder.asp", 
        {:params => {
                 :User => @username, 
                 :passwd => @password,
                 :senderName => @senderid, 
                 :message => message, 
                 :mobilenumber => mobile_nums, 
                 :meesage_type => meesage_type, 
                 :req_delivery_report => req_delivery_report, 
                 :schedulerName => schedulerName,
                 :scheduledDateTime => scheduledDateTime,
                 :systemcurrenttime => systemcurrenttime  
        }}
end
sendsms(message,mobile_nums, meesage_type="N",req_delivery_report="Y") click to toggle source
# File lib/smscountry.rb, line 14
def sendsms(message,mobile_nums, meesage_type="N",req_delivery_report="Y")
        response = RestClient.get "http://api.smscountry.com/SMSCwebservice_bulk.aspx?User=#{@username}&passwd=#{@password}&mobilenumber=#{mobile_nums}&message=#{message}&sid=#{@senderid}&mtype=#{meesage_type}&DR=#{req_delivery_report}"
        puts response.inspect
end
view_all_scheduled_sms() click to toggle source
# File lib/smscountry.rb, line 72
def view_all_scheduled_sms
        response = RestClient.get "http://www.smscountry.com/APIViewAllReminders.asp",
        {
        :params => {
                :User => @username, 
                :passwd => @password
                }
        }
        report_data = response.body.split("\\n<br/>")
        puts report_data.inspect
end
view_single_scheduled_sms(reminder_id) click to toggle source
# File lib/smscountry.rb, line 60
def view_single_scheduled_sms(reminder_id)
        response = RestClient.get "http://www.smscountry.com/APIViewReminder.asp",
        {
        :params => {
                :User => @username, 
                :passwd => @password,
                :RID => reminder_id
                }
        }
        puts response.inspect
end