Class: Posthubify::SmsResource
- Inherits:
-
Object
- Object
- Posthubify::SmsResource
- Defined in:
- lib/posthubify/resources/telecom.rb
Overview
Branded SMS sending + delivery tracking (Node sdk .sms).
Instance Method Summary collapse
-
#get(id) ⇒ Object
Delivery status (DLR): messageId or provider message id.
-
#initialize(http) ⇒ SmsResource
constructor
A new instance of SmsResource.
-
#send(input, idempotency_key: nil) ⇒ Object
Send a branded SMS ({ ‘senderId’ => …, ‘to’ => …, ‘text’ => … }); returns messageId.
Constructor Details
#initialize(http) ⇒ SmsResource
Returns a new instance of SmsResource.
55 56 57 |
# File 'lib/posthubify/resources/telecom.rb', line 55 def initialize(http) @http = http end |
Instance Method Details
#get(id) ⇒ Object
Delivery status (DLR): messageId or provider message id.
65 66 67 |
# File 'lib/posthubify/resources/telecom.rb', line 65 def get(id) @http.data('GET', "/sms/#{id}") end |
#send(input, idempotency_key: nil) ⇒ Object
Send a branded SMS ({ ‘senderId’ => …, ‘to’ => …, ‘text’ => … }); returns messageId.
60 61 62 |
# File 'lib/posthubify/resources/telecom.rb', line 60 def send(input, idempotency_key: nil) @http.data('POST', '/sms', body: input, idempotency_key: idempotency_key) end |