Class: Telesign::MessagingClient
- Inherits:
-
RestClient
- Object
- RestClient
- Telesign::MessagingClient
- Defined in:
- lib/telesign/messaging.rb
Overview
TeleSign’s Messaging API allows you to easily send SMS messages. You can send alerts, reminders, and notifications, or you can send verification messages containing one-time passcodes (OTP).
Instance Method Summary collapse
-
#message(phone_number, message, message_type, **params) ⇒ Object
Send an SMS message to the target phone number.
-
#status(reference_id, **params) ⇒ Object
Retrieve the status of an SMS transaction.
Methods inherited from RestClient
#delete, generate_telesign_headers, #get, #initialize, #post, #put
Constructor Details
This class inherits a constructor from Telesign::RestClient
Instance Method Details
#message(phone_number, message, message_type, **params) ⇒ Object
Send an SMS message to the target phone number.
See developer.telesign.com/docs/messaging-api for detailed API documentation.
15 16 17 18 19 20 21 22 |
# File 'lib/telesign/messaging.rb', line 15 def (phone_number, , , **params) self.post(MESSAGING_RESOURCE, phone_number: phone_number, message: , message_type: , **params) end |
#status(reference_id, **params) ⇒ Object
Retrieve the status of an SMS transaction.
See developer.telesign.com/docs/messaging-api for detailed API documentation.
27 28 29 30 31 |
# File 'lib/telesign/messaging.rb', line 27 def status(reference_id, **params) self.get(MESSAGING_STATUS_RESOURCE % {:reference_id => reference_id}, **params) end |