Class: ISMS::Client
- Inherits:
-
Object
- Object
- ISMS::Client
- Defined in:
- lib/isms/client.rb
Constant Summary collapse
- SEND_SMS_URL =
'/isms_send.php'
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
-
#send_sms(message_body, phone_no, type = 1) ⇒ Object
Returns Hash of :code and :description code has the error code number description is the error description www.isms.com.my/sms_api.php#SendSMS_Response.
Constructor Details
Instance Method Details
#send_sms(message_body, phone_no, type = 1) ⇒ Object
Returns Hash of :code and :description code has the error code number description is the error description www.isms.com.my/sms_api.php#SendSMS_Response
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/isms/client.rb', line 19 def send_sms(, phone_no, type = 1) request_body = {} request_body[:un] = ISMS.username request_body[:pwd] = ISMS.password request_body[:dstno] = phone_no request_body[:msg] = request_body[:type] = type faraday_response = connection.post do |request| request.url SEND_SMS_URL request.body = request_body end parse_response(faraday_response.body) end |