Class: Telnyx::Resources::Dir::References

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/dir/references.rb,
sig/telnyx/resources/dir/references.rbs

Overview

Submit and manage the two business references and one financial reference that vouch for a DIR. References are contacted to confirm the business identity during vetting.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ References

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

Parameters:



155
156
157
# File 'lib/telnyx/resources/dir/references.rb', line 155

def initialize(client:)
  @client = client
end

Instance Method Details

#create(dir_id, business_references:, financial_reference:, request_options: {}) ⇒ Telnyx::Models::Dir::ReferenceList

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

Submit the two business references and one financial reference for a DIR.

The DIR's authorizer email must be verified first (see the email-verification endpoint). Until it is, this returns 409 and no references are stored.

The request body carries exactly two business references plus one financial reference. The first submission stores them and returns 201. Resubmitting returns 200: identical values are simply confirmed and nothing is written, while changed values replace those references.

Replacing a reference is allowed only while the DIR itself is still editable, the same window in which a single reference may be updated; once the DIR has been submitted for vetting this returns 400. A replaced reference's pending verification call is cancelled and its dial-in code stops working, and the replacement contact is emailed fresh scheduling details. References whose details did not change keep their existing call, code, and the notice already sent to them.

The response always echoes the stored references in the same shape as the GET.

Who qualifies: the two business references confirm the company's reputation and operations. Each should be a senior contact at an organization the business works with, such as a vendor, partner, or client: a C-suite executive (CEO, CFO, CTO, COO), an owner or founder as reflected in the company's corporate records, or a senior manager, director, or executive. The financial reference confirms the company pays its bills and should be a licensed certified public accountant (CPA) the company uses, a contact at a bank or financial institution that has a relationship with the company, or a reasonable alternative banking or financial reference.

Parameters:

Returns:

See Also:



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

def create(dir_id, params)
  parsed, options = Telnyx::Dir::ReferenceCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["dir/%1$s/references", dir_id],
    body: parsed,
    model: Telnyx::Dir::ReferenceList,
    options: options
  )
end

#list(dir_id, request_options: {}) ⇒ Telnyx::Models::Dir::ReferenceList

List the business and financial references submitted for a DIR.

Returns the two business references (slots 1 and 2) followed by the single financial reference. Each entry carries its ref_type and slot, which together address the reference when updating it, alongside the details supplied when it was submitted (name, title, organization, relationship, phone, email, timezone). No internal identifiers are exposed. Returns an empty list when no references were submitted.

Parameters:

  • dir_id (String)

    The DIR id. Lowercase UUID.

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

Returns:

See Also:



143
144
145
146
147
148
149
150
# File 'lib/telnyx/resources/dir/references.rb', line 143

def list(dir_id, params = {})
  @client.request(
    method: :get,
    path: ["dir/%1$s/references", dir_id],
    model: Telnyx::Dir::ReferenceList,
    options: params[:request_options]
  )
end

#update(slot, dir_id:, ref_type:, email: nil, full_name: nil, job_title: nil, organization: nil, phone_e164: nil, relationship_to_registrant: nil, timezone: nil, request_options: {}) ⇒ Telnyx::Models::Dir::ReferenceUpdateResponse

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

Partially update one reference, addressed by the DIR id plus the reference's type (business or financial) and slot.

Cosmetic fields (full name, job title, organization, relationship, email) are always editable. The phone number and timezone may only be changed while a scheduled call has not yet been dialed; if a call is in progress or all attempts are complete, those fields are locked. Changing the timezone reschedules any pending call into the new local calling window.

Parameters:

  • slot (Integer)

    Path param: Reference slot, counting from 1. Business references are slots 1 and

  • dir_id (String)

    Path param: The DIR id. Lowercase UUID.

  • ref_type (Symbol, Telnyx::Models::Dir::ReferenceUpdateParams::RefType)

    Path param: Reference type to address.

  • email (String)

    Body param: Reference contact email address.

  • full_name (String)

    Body param: Full name of the reference contact.

  • job_title (String, nil)

    Body param: Job title of the reference contact.

  • organization (String, nil)

    Body param: Organization the reference contact belongs to.

  • phone_e164 (String)

    Body param: Reference phone number in E.164 format.

  • relationship_to_registrant (String, nil)

    Body param: How the reference contact is related to the registering business.

  • timezone (String)

    Body param: IANA timezone id for the reference.

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

Returns:

See Also:



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/telnyx/resources/dir/references.rb', line 106

def update(slot, params)
  parsed, options = Telnyx::Dir::ReferenceUpdateParams.dump_request(params)
  dir_id =
    parsed.delete(:dir_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  ref_type =
    parsed.delete(:ref_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["dir/%1$s/references/%2$s/%3$s", dir_id, ref_type, slot],
    body: parsed,
    model: Telnyx::Models::Dir::ReferenceUpdateResponse,
    options: options
  )
end