Class: Telesign::VoiceClient

Inherits:
RestClient show all
Defined in:
lib/telesign/voice.rb

Overview

TeleSign’s Voice API allows you to easily send voice messages. You can send alerts, reminders, and notifications, or you can send verification messages containing time-based, one-time passcodes (TOTP).

Instance Method Summary collapse

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

#call(phone_number, message, message_type, **params) ⇒ Object

Send a voice call to the target phone_number.

See developer.telesign.com/docs/voice-api for detailed API documentation.



15
16
17
18
19
20
21
22
# File 'lib/telesign/voice.rb', line 15

def call(phone_number, message, message_type, **params)

  self.post(VOICE_RESOURCE,
            phone_number: phone_number,
            message: message,
            message_type: message_type,
            **params)
end

#status(reference_id, **params) ⇒ Object

Retrieves the current status of the voice call.

See developer.telesign.com/docs/voice-api for detailed API documentation.



27
28
29
30
31
# File 'lib/telesign/voice.rb', line 27

def status(reference_id, **params)

  self.get(VOICE_STATUS_RESOURCE % {:reference_id => reference_id},
           **params)
end