Class: Zavudev::Resources::Introspect

Inherits:
Object
  • Object
show all
Defined in:
lib/zavudev/resources/introspect.rb,
sig/zavudev/resources/introspect.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Introspect

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

Parameters:



63
64
65
# File 'lib/zavudev/resources/introspect.rb', line 63

def initialize(client:)
  @client = client
end

Instance Method Details

#validate_email(email: nil, emails: nil, request_options: {}) ⇒ Zavudev::Models::IntrospectValidateEmailResponse

Heuristic email validation to run before sending: catches invalid syntax, dead domains (no MX/A records), disposable inboxes, role-based addresses (info@, contacto@, sales@), and addresses already on your project's suppression list. Use it to clean a list before a broadcast and keep your bounce rate low.

No mailbox-level (SMTP) probe is performed, so a deliverable verdict is not a delivery guarantee — it means no negative signal was found. Treat risky addresses with care and drop undeliverable ones.

Accepts a single email or an emails batch (max 100 per request).

Parameters:

  • email (String) —

    Single email address to validate.

  • emails (Array<String>) —

    Batch of email addresses to validate (max 100).

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

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/zavudev/resources/introspect.rb', line 28

def validate_email(params = {})
  parsed, options = Zavudev::IntrospectValidateEmailParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/introspect/email",
    body: parsed,
    model: Zavudev::Models::IntrospectValidateEmailResponse,
    options: options
  )
end

#validate_phone(phone_number:, request_options: {}) ⇒ Zavudev::Models::IntrospectValidatePhoneResponse

Validate a phone number and check if a WhatsApp conversation window is open.

Parameters:

Returns:

See Also:



49
50
51
52
53
54
55
56
57
58
# File 'lib/zavudev/resources/introspect.rb', line 49

def validate_phone(params)
  parsed, options = Zavudev::IntrospectValidatePhoneParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/introspect/phone",
    body: parsed,
    model: Zavudev::Models::IntrospectValidatePhoneResponse,
    options: options
  )
end