Class: TelesignEnterprise::VerifyClient

Inherits:
Telesign::RestClient
  • Object
show all
Defined in:
lib/telesignenterprise/verify.rb

Overview

The Verify API delivers phone-based verification and two-factor authentication using a time-based, one-time passcode sent via SMS message and Voice call.

Instance Method Summary collapse

Constructor Details

#initialize(customer_id, api_key, rest_endpoint: 'https://rest-ww.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version, rest_endpoint_verify: 'https://verify.telesign.com') ⇒ VerifyClient

Returns a new instance of VerifyClient.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/telesignenterprise/verify.rb', line 17

def initialize(customer_id,
               api_key,
               rest_endpoint: 'https://rest-ww.telesign.com',
               timeout: nil,
               source: 'ruby_telesign_enterprise',
               sdk_version_origin: TelesignEnterprise::SDK_VERSION,
               sdk_version_dependency: Gem.loaded_specs['telesign'].version,
               rest_endpoint_verify: 'https://verify.telesign.com')

  @omniVerifyClient = OmniVerifyClient.new(customer_id, api_key, rest_endpoint: rest_endpoint_verify)
  super(customer_id,
        api_key,
        rest_endpoint: rest_endpoint,
        timeout: timeout,
        source: source,
        sdk_version_origin: sdk_version_origin,
        sdk_version_dependency: sdk_version_dependency)
end

Instance Method Details

#completion(reference_id, **params) ⇒ Object

Notifies TeleSign that a verification was successfully delivered to the user in order to help improve the quality of message delivery routes.

See https://developer.telesign.com/docs/completion-service-for-verify-products for detailed API documentation.



80
81
82
83
# File 'lib/telesignenterprise/verify.rb', line 80

def completion(reference_id, **params)
  self.put(VERIFY_COMPLETION_RESOURCE % {:reference_id => reference_id},
           **params)
end

#create_verification_process(phone_number, **params) ⇒ Object

Use this action to create a verification process for the specified phone number.

See https://developer.telesign.com/enterprise/reference/createverificationprocess for detailed API documentation.



88
89
90
# File 'lib/telesignenterprise/verify.rb', line 88

def create_verification_process(phone_number, **params)
  @omniVerifyClient.create_verification_process(phone_number, **params)
end

#smart(phone_number, ucid, **params) ⇒ Object

The Smart Verify web service simplifies the process of verifying user identity by integrating several TeleSign web services into a single API call. This eliminates the need for you to make multiple calls to the TeleSign Verify resource.

See https://developer.telesign.com/docs/rest_api-smart-verify for detailed API documentation.



61
62
63
64
65
66
# File 'lib/telesignenterprise/verify.rb', line 61

def smart(phone_number, ucid, **params)
  self.post(VERIFY_SMART_RESOURCE,
            phone_number: phone_number,
            ucid: ucid,
            **params)
end

#sms(phone_number, **params) ⇒ Object

The SMS Verify API delivers phone-based verification and two-factor authentication using a time-based, one-time passcode sent over SMS.

See https://developer.telesign.com/docs/rest_api-verify-sms for detailed API documentation.



40
41
42
43
44
# File 'lib/telesignenterprise/verify.rb', line 40

def sms(phone_number, **params)
  self.post(VERIFY_SMS_RESOURCE,
            phone_number: phone_number,
            **params)
end

#status(reference_id, **params) ⇒ Object

Retrieves the verification result for any verify resource.

See https://developer.telesign.com/docs/rest_api-verify-transaction-callback for detailed API documentation.



71
72
73
74
# File 'lib/telesignenterprise/verify.rb', line 71

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

#voice(phone_number, **params) ⇒ Object

The Voice Verify API delivers patented phone-based verification and two-factor authentication using a one-time passcode sent over voice message.

See https://developer.telesign.com/docs/rest_api-verify-call for detailed API documentation.



50
51
52
53
54
# File 'lib/telesignenterprise/verify.rb', line 50

def voice(phone_number, **params)
  self.post(VERIFY_VOICE_RESOURCE,
            phone_number: phone_number,
            **params)
end