Class: Telnyx::Resources::Messaging10dlc::Brand

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/messaging_10dlc/brand.rb,
lib/telnyx/resources/messaging_10dlc/brand/external_vetting.rb

Overview

Brand operations

Defined Under Namespace

Classes: ExternalVetting

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Brand

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

Parameters:



483
484
485
486
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 483

def initialize(client:)
  @client = client
  @external_vetting = Telnyx::Resources::Messaging10dlc::Brand::ExternalVetting.new(client: client)
end

Instance Attribute Details

#external_vettingTelnyx::Resources::Messaging10dlc::Brand::ExternalVetting (readonly)

Brand operations



10
11
12
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 10

def external_vetting
  @external_vetting
end

Instance Method Details

#create(country:, display_name:, email:, entity_type:, vertical:, business_contact_email: nil, city: nil, company_name: nil, ein: nil, first_name: nil, ip_address: nil, is_reseller: nil, last_name: nil, mobile_phone: nil, mock: nil, phone: nil, postal_code: nil, state: nil, stock_exchange: nil, stock_symbol: nil, street: nil, webhook_failover_url: nil, webhook_url: nil, website: nil, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::TelnyxBrand

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

This endpoint is used to create a new brand. A brand is an entity created by The Campaign Registry (TCR) that represents an organization or a company. It is this entity that TCR created campaigns will be associated with. Each brand creation will entail an upfront, non-refundable $4 expense.

Parameters:

  • country (String)

    ISO2 2 characters country code. Example: US - United States

  • display_name (String)

    Display name, marketing name, or DBA name of the brand.

  • email (String)

    Valid email address of brand support contact.

  • entity_type (Symbol, Telnyx::Models::Messaging10dlc::EntityType)

    Entity type behind the brand. This is the form of business establishment.

  • vertical (Symbol, Telnyx::Models::Messaging10dlc::Vertical)

    Vertical or industry segment of the brand or campaign.

  • business_contact_email (String)

    Business contact email.

  • city (String)

    City name

  • company_name (String)

    (Required for Non-profit/private/public) Legal company name.

  • ein (String)

    (Required for Non-profit) Government assigned corporate tax ID. EIN is 9-digits

  • first_name (String)

    First name of business contact.

  • ip_address (String)

    IP address of the browser requesting to create brand identity.

  • is_reseller (Boolean)
  • last_name (String)

    Last name of business contact.

  • mobile_phone (String)

    Valid mobile phone number in e.164 international format.

  • mock (Boolean)

    Mock brand for testing purposes. Defaults to false.

  • phone (String)

    Valid phone number in e.164 international format.

  • postal_code (String)

    Postal codes. Use 5 digit zipcode for United States

  • state (String)

    State. Must be 2 letters code for United States.

  • stock_exchange (Symbol, Telnyx::Models::Messaging10dlc::StockExchange)

    (Required for public company) stock exchange.

  • stock_symbol (String)

    (Required for public company) stock symbol.

  • street (String)

    Street number and name.

  • webhook_failover_url (String)

    Webhook failover URL for brand status updates.

  • webhook_url (String)

    Webhook URL for brand status updates.

  • website (String)

    Brand website URL.

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

Returns:

See Also:



75
76
77
78
79
80
81
82
83
84
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 75

def create(params)
  parsed, options = Telnyx::Messaging10dlc::BrandCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "10dlc/brand",
    body: parsed,
    model: Telnyx::Messaging10dlc::TelnyxBrand,
    options: options
  )
end

#delete(brand_id, request_options: {}) ⇒ nil

Delete Brand. This endpoint is used to delete a brand. Note the brand cannot be deleted if it contains one or more active campaigns, the campaigns need to be inactive and at least 3 months old due to billing purposes.

Parameters:

  • brand_id (String)

    Unique identifier of the brand.

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

Returns:

  • (nil)

See Also:



243
244
245
246
247
248
249
250
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 243

def delete(brand_id, params = {})
  @client.request(
    method: :delete,
    path: ["10dlc/brand/%1$s", brand_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#get_feedback(brand_id, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::BrandGetFeedbackResponse

Get feedback about a brand by ID. This endpoint can be used after creating or revetting a brand.

Possible values for ‘.category[].id`:

  • ‘TAX_ID` - Data mismatch related to tax id and its associated properties.

  • ‘STOCK_SYMBOL` - Non public entity registered as a public for profit entity or the stock information mismatch.

  • ‘GOVERNMENT_ENTITY` - Non government entity registered as a government entity. Must be a U.S. government entity.

  • ‘NONPROFIT` - Not a recognized non-profit entity. No IRS tax-exempt status found.

  • ‘OTHERS` - Details of the data misrepresentation if any.

Parameters:

  • brand_id (String)

    Unique identifier of the brand.

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

Returns:

See Also:



275
276
277
278
279
280
281
282
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 275

def get_feedback(brand_id, params = {})
  @client.request(
    method: :get,
    path: ["10dlc/brand/feedback/%1$s", brand_id],
    model: Telnyx::Models::Messaging10dlc::BrandGetFeedbackResponse,
    options: params[:request_options]
  )
end

#get_sms_otp_by_reference(reference_id, brand_id: nil, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::BrandGetSMSOtpByReferenceResponse

Query the status of an SMS OTP (One-Time Password) for Sole Proprietor brand verification.

This endpoint allows you to check the delivery and verification status of an OTP sent during the Sole Proprietor brand verification process. You can query by either:

  • ‘referenceId` - The reference ID returned when the OTP was initially triggered

  • ‘brandId` - Query parameter for portal users to look up OTP status by Brand ID

The response includes delivery status, verification dates, and detailed delivery information.

Parameters:

  • reference_id (String)

    The reference ID returned when the OTP was initially triggered

  • brand_id (String)

    Filter by Brand ID for easier lookup in portal applications

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

Returns:

See Also:



308
309
310
311
312
313
314
315
316
317
318
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 308

def get_sms_otp_by_reference(reference_id, params = {})
  parsed, options = Telnyx::Messaging10dlc::BrandGetSMSOtpByReferenceParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["10dlc/brand/smsOtp/%1$s", reference_id],
    query: query.transform_keys(brand_id: "brandId"),
    model: Telnyx::Models::Messaging10dlc::BrandGetSMSOtpByReferenceResponse,
    options: options
  )
end

#list(brand_id: nil, country: nil, display_name: nil, entity_type: nil, page: nil, records_per_page: nil, sort: nil, state: nil, tcr_brand_id: nil, request_options: {}) ⇒ Telnyx::Internal::PerPagePaginationV2<Telnyx::Models::Messaging10dlc::BrandListResponse>

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

This endpoint is used to list all brands associated with your organization.

Parameters:

  • brand_id (String)

    Filter results by the Telnyx Brand id

  • country (String)

    Filter results by country.

  • display_name (String)

    Filter results by display name.

  • entity_type (String)

    Filter results by entity type.

  • page (Integer)

    Page number to retrieve (1-based).

  • records_per_page (Integer)

    number of records per page. maximum of 500

  • sort (Symbol, Telnyx::Models::Messaging10dlc::BrandListParams::Sort)

    Specifies the sort order for results. If not given, results are sorted by create

  • state (String)

    Filter results by state.

  • tcr_brand_id (String)

    Filter results by the TCR Brand id

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

Returns:

See Also:



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 211

def list(params = {})
  parsed, options = Telnyx::Messaging10dlc::BrandListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "10dlc/brand",
    query: query.transform_keys(
      brand_id: "brandId",
      display_name: "displayName",
      entity_type: "entityType",
      records_per_page: "recordsPerPage",
      tcr_brand_id: "tcrBrandId"
    ),
    page: Telnyx::Internal::PerPagePaginationV2,
    model: Telnyx::Models::Messaging10dlc::BrandListResponse,
    options: options
  )
end

#resend_2fa_email(brand_id, request_options: {}) ⇒ nil

Resend brand 2FA email

Parameters:

  • brand_id (String)

    Unique identifier of the brand.

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

Returns:

  • (nil)

See Also:



331
332
333
334
335
336
337
338
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 331

def resend_2fa_email(brand_id, params = {})
  @client.request(
    method: :post,
    path: ["10dlc/brand/%1$s/2faEmail", brand_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#retrieve(brand_id, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::BrandRetrieveResponse

Retrieve a brand by ‘brandId`.

Parameters:

  • brand_id (String)

    Unique identifier of the brand.

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

Returns:

See Also:



97
98
99
100
101
102
103
104
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 97

def retrieve(brand_id, params = {})
  @client.request(
    method: :get,
    path: ["10dlc/brand/%1$s", brand_id],
    model: Telnyx::Models::Messaging10dlc::BrandRetrieveResponse,
    options: params[:request_options]
  )
end

#retrieve_sms_otp_status(brand_id, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::BrandRetrieveSMSOtpStatusResponse

Query the status of an SMS OTP (One-Time Password) for Sole Proprietor brand verification using the Brand ID.

This endpoint allows you to check the delivery and verification status of an OTP sent during the Sole Proprietor brand verification process by looking it up with the brand ID.

The response includes delivery status, verification dates, and detailed delivery information.

Note: This is an alternative to the ‘/10dlc/brand/smsOtp/referenceId` endpoint when you have the Brand ID but not the reference ID.

Parameters:

  • brand_id (String)

    The Brand ID for which to query OTP status

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

Returns:

See Also:



362
363
364
365
366
367
368
369
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 362

def retrieve_sms_otp_status(brand_id, params = {})
  @client.request(
    method: :get,
    path: ["10dlc/brand/%1$s/smsOtp", brand_id],
    model: Telnyx::Models::Messaging10dlc::BrandRetrieveSMSOtpStatusResponse,
    options: params[:request_options]
  )
end

#revet(brand_id, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::TelnyxBrand

This operation allows you to revet the brand. However, revetting is allowed once after the successful brand registration and thereafter limited to once every 3 months.

Parameters:

  • brand_id (String)

    Unique identifier of the brand.

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

Returns:

See Also:



384
385
386
387
388
389
390
391
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 384

def revet(brand_id, params = {})
  @client.request(
    method: :put,
    path: ["10dlc/brand/%1$s/revet", brand_id],
    model: Telnyx::Messaging10dlc::TelnyxBrand,
    options: params[:request_options]
  )
end

#trigger_sms_otp(brand_id, pin_sms:, success_sms:, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::BrandTriggerSMSOtpResponse

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

Trigger or re-trigger an SMS OTP (One-Time Password) for Sole Proprietor brand verification.

**Important Notes:**

  • Only allowed for Sole Proprietor (‘SOLE_PROPRIETOR`) brands

  • Triggers generation of a one-time password sent to the ‘mobilePhone` number in the brand’s profile

  • Campaigns cannot be created until OTP verification is complete

  • US/CA numbers only for real OTPs; mock brands can use non-US/CA numbers for testing

  • Returns a ‘referenceId` that can be used to check OTP status via the GET `/10dlc/brand/smsOtp/referenceId` endpoint

**Use Cases:**

  • Initial OTP trigger after Sole Proprietor brand creation

  • Re-triggering OTP if the user didn’t receive or needs a new code

Parameters:

  • brand_id (String)

    The Brand ID for which to trigger the OTP

  • pin_sms (String)

    SMS message template to send the OTP. Must include ‘@OTP_PIN@` placeholder which

  • success_sms (String)

    SMS message to send upon successful OTP verification

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

Returns:

See Also:



428
429
430
431
432
433
434
435
436
437
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 428

def trigger_sms_otp(brand_id, params)
  parsed, options = Telnyx::Messaging10dlc::BrandTriggerSMSOtpParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["10dlc/brand/%1$s/smsOtp", brand_id],
    body: parsed,
    model: Telnyx::Models::Messaging10dlc::BrandTriggerSMSOtpResponse,
    options: options
  )
end

#update(brand_id, country:, display_name:, email:, entity_type:, vertical:, alt_business_id: nil, alt_business_id_type: nil, business_contact_email: nil, city: nil, company_name: nil, ein: nil, first_name: nil, identity_status: nil, ip_address: nil, is_reseller: nil, last_name: nil, phone: nil, postal_code: nil, state: nil, stock_exchange: nil, stock_symbol: nil, street: nil, webhook_failover_url: nil, webhook_url: nil, website: nil, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::TelnyxBrand

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

Update a brand’s attributes by ‘brandId`.

Parameters:

  • brand_id (String)

    Unique identifier of the brand.

  • country (String)

    ISO2 2 characters country code. Example: US - United States

  • display_name (String)

    Display or marketing name of the brand.

  • email (String)

    Valid email address of brand support contact.

  • entity_type (Symbol, Telnyx::Models::Messaging10dlc::EntityType)

    Entity type behind the brand. This is the form of business establishment.

  • vertical (Symbol, Telnyx::Models::Messaging10dlc::Vertical)

    Vertical or industry segment of the brand or campaign.

  • alt_business_id (String)

    Alternate business identifier such as DUNS, LEI, or GIIN

  • alt_business_id_type (Symbol, Telnyx::Models::Messaging10dlc::AltBusinessIDType)

    An enumeration.

  • business_contact_email (String)

    Business contact email.

  • city (String)

    City name

  • company_name (String)

    (Required for Non-profit/private/public) Legal company name.

  • ein (String)

    (Required for Non-profit) Government assigned corporate tax ID. EIN is 9-digits

  • first_name (String)

    First name of business contact.

  • identity_status (Symbol, Telnyx::Models::Messaging10dlc::BrandIdentityStatus)

    The verification status of an active brand

  • ip_address (String)

    IP address of the browser requesting to create brand identity.

  • is_reseller (Boolean)
  • last_name (String)

    Last name of business contact.

  • phone (String)

    Valid phone number in e.164 international format.

  • postal_code (String)

    Postal codes. Use 5 digit zipcode for United States

  • state (String)

    State. Must be 2 letters code for United States.

  • stock_exchange (Symbol, Telnyx::Models::Messaging10dlc::StockExchange)

    (Required for public company) stock exchange.

  • stock_symbol (String)

    (Required for public company) stock symbol.

  • street (String)

    Street number and name.

  • webhook_failover_url (String)

    Webhook failover URL for brand status updates.

  • webhook_url (String)

    Webhook URL for brand status updates.

  • website (String)

    Brand website URL.

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

Returns:

See Also:



170
171
172
173
174
175
176
177
178
179
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 170

def update(brand_id, params)
  parsed, options = Telnyx::Messaging10dlc::BrandUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["10dlc/brand/%1$s", brand_id],
    body: parsed,
    model: Telnyx::Messaging10dlc::TelnyxBrand,
    options: options
  )
end

#verify_sms_otp(brand_id, otp_pin:, request_options: {}) ⇒ nil

Verify the SMS OTP (One-Time Password) for Sole Proprietor brand verification.

**Verification Flow:**

  1. User receives OTP via SMS after triggering

  2. User submits the OTP pin through this endpoint

  3. Upon successful verification:

    • A ‘BRAND_OTP_VERIFIED` webhook event is sent to the CSP

    • The brand’s ‘identityStatus` changes to `VERIFIED`

    • Campaigns can now be created for this brand

**Error Handling:**

Provides proper error responses for:

  • Invalid OTP pins

  • Expired OTPs

  • OTP verification failures

Parameters:

  • brand_id (String)

    The Brand ID for which to verify the OTP

  • otp_pin (String)

    The OTP PIN received via SMS

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

Returns:

  • (nil)

See Also:



469
470
471
472
473
474
475
476
477
478
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 469

def verify_sms_otp(brand_id, params)
  parsed, options = Telnyx::Messaging10dlc::BrandVerifySMSOtpParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["10dlc/brand/%1$s/smsOtp", brand_id],
    body: parsed,
    model: NilClass,
    options: options
  )
end