Class: ApiBrasil::Services::Messaging::SmsService
- Inherits:
-
DeviceProxyService
- Object
- BaseService
- DeviceProxyService
- ApiBrasil::Services::Messaging::SmsService
- Defined in:
- lib/api_brasil/services/messaging/sms_service.rb
Overview
API de SMS (device-based): POST /sms/{action}.
Exige Authorization: Bearer + DeviceToken.
Instance Attribute Summary
Attributes inherited from DeviceProxyService
Attributes inherited from BaseService
Instance Method Summary collapse
-
#initialize(http) ⇒ SmsService
constructor
A new instance of SmsService.
-
#send_message(body, options = {}) ⇒ Object
(also: #send)
Envia um SMS pelo device:
POST /sms/send. -
#send_with_credits(body, options = {}) ⇒ Object
Envia um SMS debitando creditos da conta (sem DeviceToken):
POST /sms/send/credits.
Methods inherited from DeviceProxyService
Methods inherited from BaseService
#delete, #download, #get, #patch, #post, #put
Constructor Details
#initialize(http) ⇒ SmsService
Returns a new instance of SmsService.
11 12 13 |
# File 'lib/api_brasil/services/messaging/sms_service.rb', line 11 def initialize(http) super(http, "sms") end |
Instance Method Details
#send_message(body, options = {}) ⇒ Object Also known as: send
Envia um SMS pelo device: POST /sms/send.
Campos: number, message, operator, user_reply, webhook_url.
20 21 22 |
# File 'lib/api_brasil/services/messaging/sms_service.rb', line 20 def (body, = {}) request("send", body, ) end |
#send_with_credits(body, options = {}) ⇒ Object
Envia um SMS debitando creditos da conta (sem DeviceToken):
POST /sms/send/credits.
34 35 36 |
# File 'lib/api_brasil/services/messaging/sms_service.rb', line 34 def send_with_credits(body, = {}) post("/sms/send/credits", body, ) end |