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

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:



439
440
441
442
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 439

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)



8
9
10
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 8

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:



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

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:

Returns:

  • (nil)

See Also:



238
239
240
241
242
243
244
245
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 238

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:

Returns:

See Also:



269
270
271
272
273
274
275
276
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 269

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

#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)
  • display_name (String)
  • entity_type (String)
  • page (Integer)
  • 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)
  • tcr_brand_id (String)

    Filter results by the TCR Brand id

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

Returns:

See Also:



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 208

def list(params = {})
  parsed, options = Telnyx::Messaging10dlc::BrandListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "10dlc/brand",
    query: parsed.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:

Returns:

  • (nil)

See Also:



288
289
290
291
292
293
294
295
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 288

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:

Returns:

See Also:



94
95
96
97
98
99
100
101
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 94

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:



319
320
321
322
323
324
325
326
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 319

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:

Returns:

See Also:



340
341
342
343
344
345
346
347
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 340

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:



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

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)
  • 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:



167
168
169
170
171
172
173
174
175
176
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 167

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:



425
426
427
428
429
430
431
432
433
434
# File 'lib/telnyx/resources/messaging_10dlc/brand.rb', line 425

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