Simple Gem Wrapper for SMSAPI.pl
Cuurent supported version of API - 3.1
Usage
Smsapipl.configure do |config| config.token = 'XYZ' # You need to get it from SMSAPI.pl portal config.from = 'NAME' # You need to define it in SMSAPI.pl portal end
Profile
profile = Smsapipl::Profile.check ## Returns unparsed JSON points = Smsapipl::Profile.points ## Returns float with points remaining
SMS
Single SMS
sms = Smsapipl::Sms.send(message: 'Lorem ipsum', to: 'PHONE-NUMBER', optional_params: {date: '1577878200'}) sms -> "OK:677AE5C334633117B60A49A6:0.155"
Template SMS
sms = Smsapipl::SmsTemplate.send(template: 'TEMPLATE-NAME', to: 'PHONE-NUMBER', template_params: {param1: 'A', param2: 'B'}) sms -> "OK:677AE5C334633117B60A49A6:0.155" You need to define template in SMSAPI.pl portal. Params only allowed in form paramX where X-> (1..4)
Build
BUILD gem build *.gemspec -o pkg/smsapipl.gem
INSTALL gem install pkg/*.gem