Class: Telnyx::Resources::Verifications

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/verifications.rb,
lib/telnyx/resources/verifications/actions.rb,
lib/telnyx/resources/verifications/by_phone_number.rb,
lib/telnyx/resources/verifications/by_phone_number/actions.rb

Overview

Two factor authentication API

Defined Under Namespace

Classes: Actions, ByPhoneNumber

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Verifications

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Verifications.

Parameters:



153
154
155
156
157
# File 'lib/telnyx/resources/verifications.rb', line 153

def initialize(client:)
  @client = client
  @by_phone_number = Telnyx::Resources::Verifications::ByPhoneNumber.new(client: client)
  @actions = Telnyx::Resources::Verifications::Actions.new(client: client)
end

Instance Attribute Details

#actionsTelnyx::Resources::Verifications::Actions (readonly)

Two factor authentication API



13
14
15
# File 'lib/telnyx/resources/verifications.rb', line 13

def actions
  @actions
end

#by_phone_numberTelnyx::Resources::Verifications::ByPhoneNumber (readonly)

Two factor authentication API



9
10
11
# File 'lib/telnyx/resources/verifications.rb', line 9

def by_phone_number
  @by_phone_number
end

Instance Method Details

#retrieve(verification_id, request_options: {}) ⇒ Telnyx::Models::VerificationRetrieveResponse

Retrieve verification

Parameters:

  • verification_id (String)

    The identifier of the verification to retrieve.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



26
27
28
29
30
31
32
33
# File 'lib/telnyx/resources/verifications.rb', line 26

def retrieve(verification_id, params = {})
  @client.request(
    method: :get,
    path: ["verifications/%1$s", verification_id],
    model: Telnyx::Models::VerificationRetrieveResponse,
    options: params[:request_options]
  )
end

#trigger_call(phone_number:, verify_profile_id:, custom_code: nil, extension: nil, timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::CreateVerificationResponse

Some parameter documentations has been truncated, see Models::VerificationTriggerCallParams for more details.

Trigger Call verification

Parameters:

  • phone_number (String)

    +E164 formatted phone number.

  • verify_profile_id (String)

    The identifier of the associated Verify profile.

  • custom_code (String, nil)

    Send a self-generated numeric code to the end-user

  • extension (String, nil)

    Optional extension to dial after call is answered using DTMF digits. Valid digit

  • timeout_secs (Integer)

    The number of seconds the verification code is valid for.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
# File 'lib/telnyx/resources/verifications.rb', line 57

def trigger_call(params)
  parsed, options = Telnyx::VerificationTriggerCallParams.dump_request(params)
  @client.request(
    method: :post,
    path: "verifications/call",
    body: parsed,
    model: Telnyx::CreateVerificationResponse,
    options: options
  )
end

#trigger_flashcall(phone_number:, verify_profile_id:, timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::CreateVerificationResponse

Trigger Flash call verification

Parameters:

  • phone_number (String)

    +E164 formatted phone number.

  • verify_profile_id (String)

    The identifier of the associated Verify profile.

  • timeout_secs (Integer)

    The number of seconds the verification code is valid for.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



83
84
85
86
87
88
89
90
91
92
# File 'lib/telnyx/resources/verifications.rb', line 83

def trigger_flashcall(params)
  parsed, options = Telnyx::VerificationTriggerFlashcallParams.dump_request(params)
  @client.request(
    method: :post,
    path: "verifications/flashcall",
    body: parsed,
    model: Telnyx::CreateVerificationResponse,
    options: options
  )
end

#trigger_sms(phone_number:, verify_profile_id:, custom_code: nil, timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::CreateVerificationResponse

Trigger SMS verification

Parameters:

  • phone_number (String)

    +E164 formatted phone number.

  • verify_profile_id (String)

    The identifier of the associated Verify profile.

  • custom_code (String, nil)

    Send a self-generated numeric code to the end-user

  • timeout_secs (Integer)

    The number of seconds the verification code is valid for.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



111
112
113
114
115
116
117
118
119
120
# File 'lib/telnyx/resources/verifications.rb', line 111

def trigger_sms(params)
  parsed, options = Telnyx::VerificationTriggerSMSParams.dump_request(params)
  @client.request(
    method: :post,
    path: "verifications/sms",
    body: parsed,
    model: Telnyx::CreateVerificationResponse,
    options: options
  )
end

#trigger_whatsapp_verification(phone_number:, verify_profile_id:, custom_code: nil, timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::CreateVerificationResponse

Trigger WhatsApp verification

Parameters:

  • phone_number (String)

    +E164 formatted phone number.

  • verify_profile_id (String)

    The identifier of the associated Verify profile.

  • custom_code (String, nil)

    Send a self-generated numeric code to the end-user

  • timeout_secs (Integer)

    The number of seconds the verification code is valid for.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



139
140
141
142
143
144
145
146
147
148
# File 'lib/telnyx/resources/verifications.rb', line 139

def trigger_whatsapp_verification(params)
  parsed, options = Telnyx::VerificationTriggerWhatsappVerificationParams.dump_request(params)
  @client.request(
    method: :post,
    path: "verifications/whatsapp",
    body: parsed,
    model: Telnyx::CreateVerificationResponse,
    options: options
  )
end