Class: PreludeSDK::Resources::Verification::Phone::History

Inherits:
Object
  • Object
show all
Defined in:
lib/prelude_sdk/resources/verification/phone/history.rb,
sig/prelude_sdk/resources/verification/phone/history.rbs

Overview

Verify phone numbers.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ History

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 History.

Parameters:



97
98
99
# File 'lib/prelude_sdk/resources/verification/phone/history.rb', line 97

def initialize(client:)
  @client = client
end

Instance Method Details

#list(channels: nil, cursor: nil, device_platform: nil, from: nil, limit: nil, max_attempts: nil, min_attempts: nil, phone_number: nil, region: nil, status: nil, template_id: nil, to: nil, request_options: {}) ⇒ PreludeSDK::Models::Verification::Phone::HistoryListResponse

Some parameter documentations has been truncated, see Models::Verification::Phone::HistoryListParams for more details.

List your phone verifications, most recent first, one entry per verification with its outcome, channels, attempts and cost. Every filter is optional and they combine with AND.

Use it to find every verification a phone number went through from your support tooling, then Get a phone verification for the full timeline of one of them. A cursor is bound to the filters that produced it: pass next_cursor back with the exact same query parameters.

Parameters:

  • channels (Array<Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::Channel>) —

    Only verifications that could use one of these channels. Repeat the parameter fo

  • cursor (String) —

    Pagination cursor from the previous response.

  • device_platform (Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::DevicePlatform) —

    Only verifications created from this device platform.

  • from (Time) —

    Only verifications created at or after this RFC 3339 timestamp. Goes with to,

  • limit (Integer) —

    Maximum number of verifications to return per page.

  • max_attempts (Integer) —

    Only verifications that sent at most this many messages. 0 keeps the verificat

  • min_attempts (Integer) —

    Only verifications that sent at least this many messages.

  • phone_number (String) —

    Only verifications targeting this E.164 phone number. The leading + may be omi

  • region (String) —

    Only verifications of phone numbers from this region, as an ISO 3166-1 alpha-2 c

  • status (Symbol, PreludeSDK::Models::Verification::Phone::HistoryListParams::Status) —

    Only verifications in this status. pending_check cannot be filtered on.

  • template_id (String) —

    Only verifications sent with this template, as returned in template_id by [Get

  • to (Time) —

    Only verifications created at or before this RFC 3339 timestamp. Goes with `from

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

Returns:

See Also:



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/prelude_sdk/resources/verification/phone/history.rb', line 82

def list(params = {})
  parsed, options = PreludeSDK::Verification::Phone::HistoryListParams.dump_request(params)
  query = PreludeSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v2/verification/phone/history",
    query: query,
    model: PreludeSDK::Models::Verification::Phone::HistoryListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ PreludeSDK::Models::Verification::Phone::HistoryRetrieveResponse

Retrieve everything Prelude recorded for one phone verification: its outcome and the device, network and anti-fraud context it was created in, the chronological timeline of every message attempt and code check, and the anti-fraud signals you forwarded.

The identifier is the id returned by Create or retry a verification or the verification_id of the verification webhooks. Both lifecycle and signals are optional: a verification can resolve with its top-level fields alone.

Parameters:

Returns:

See Also:



29
30
31
32
33
34
35
36
# File 'lib/prelude_sdk/resources/verification/phone/history.rb', line 29

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["v2/verification/phone/history/%1$s", id],
    model: PreludeSDK::Models::Verification::Phone::HistoryRetrieveResponse,
    options: params[:request_options]
  )
end