Class: Telnyx::Resources::MessagingProfiles

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/messaging_profiles.rb,
lib/telnyx/resources/messaging_profiles/autoresp_configs.rb

Defined Under Namespace

Classes: AutorespConfigs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ MessagingProfiles

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

Parameters:



243
244
245
246
# File 'lib/telnyx/resources/messaging_profiles.rb', line 243

def initialize(client:)
  @client = client
  @autoresp_configs = Telnyx::Resources::MessagingProfiles::AutorespConfigs.new(client: client)
end

Instance Attribute Details

#autoresp_configsTelnyx::Resources::MessagingProfiles::AutorespConfigs (readonly)



7
8
9
# File 'lib/telnyx/resources/messaging_profiles.rb', line 7

def autoresp_configs
  @autoresp_configs
end

Instance Method Details

#create(name:, whitelisted_destinations:, alpha_sender: nil, daily_spend_limit: nil, daily_spend_limit_enabled: nil, enabled: nil, mms_fall_back_to_sms: nil, mms_transcoding: nil, mobile_only: nil, number_pool_settings: nil, smart_encoding: nil, url_shortener_settings: nil, webhook_api_version: nil, webhook_failover_url: nil, webhook_url: nil, request_options: {}) ⇒ Telnyx::Models::MessagingProfileCreateResponse

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

Create a messaging profile

Parameters:

  • name (String)

    A user friendly name for the messaging profile.

  • whitelisted_destinations (Array<String>)

    Destinations to which the messaging profile is allowed to send. The elements in

  • alpha_sender (String, nil)

    The alphanumeric sender ID to use when sending to destinations that require an a

  • daily_spend_limit (String)

    The maximum amount of money (in USD) that can be spent by this profile before mi

  • daily_spend_limit_enabled (Boolean)

    Whether to enforce the value configured by ‘daily_spend_limit`.

  • enabled (Boolean)

    Specifies whether the messaging profile is enabled or not.

  • mms_fall_back_to_sms (Boolean)

    enables SMS fallback for MMS messages.

  • mms_transcoding (Boolean)

    enables automated resizing of MMS media.

  • mobile_only (Boolean)

    Send messages only to mobile phone numbers.

  • number_pool_settings (Telnyx::Models::NumberPoolSettings, nil)

    Number Pool allows you to send messages from a pool of numbers of different type

  • smart_encoding (Boolean)

    Enables automatic character encoding optimization for SMS messages. When enabled

  • url_shortener_settings (Telnyx::Models::URLShortenerSettings, nil)

    The URL shortener feature allows automatic replacement of URLs that were generat

  • webhook_api_version (Symbol, Telnyx::Models::MessagingProfileCreateParams::WebhookAPIVersion)

    Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 201

  • webhook_failover_url (String, nil)

    The failover URL where webhooks related to this messaging profile will be sent i

  • webhook_url (String, nil)

    The URL where webhooks related to this messaging profile will be sent.

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

Returns:

See Also:



51
52
53
54
55
56
57
58
59
60
# File 'lib/telnyx/resources/messaging_profiles.rb', line 51

def create(params)
  parsed, options = Telnyx::MessagingProfileCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "messaging_profiles",
    body: parsed,
    model: Telnyx::Models::MessagingProfileCreateResponse,
    options: options
  )
end

#delete(messaging_profile_id, request_options: {}) ⇒ Telnyx::Models::MessagingProfileDeleteResponse

Delete a messaging profile

Parameters:

  • messaging_profile_id (String)

    The id of the messaging profile to retrieve

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

Returns:

See Also:



177
178
179
180
181
182
183
184
# File 'lib/telnyx/resources/messaging_profiles.rb', line 177

def delete(messaging_profile_id, params = {})
  @client.request(
    method: :delete,
    path: ["messaging_profiles/%1$s", messaging_profile_id],
    model: Telnyx::Models::MessagingProfileDeleteResponse,
    options: params[:request_options]
  )
end

#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::MessagingProfile>

List messaging profiles

Parameters:

Returns:

See Also:



154
155
156
157
158
159
160
161
162
163
164
# File 'lib/telnyx/resources/messaging_profiles.rb', line 154

def list(params = {})
  parsed, options = Telnyx::MessagingProfileListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "messaging_profiles",
    query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::MessagingProfile,
    options: options
  )
end

#list_phone_numbers(messaging_profile_id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumberWithMessagingSettings>

List phone numbers associated with a messaging profile

Parameters:

  • messaging_profile_id (String)

    The id of the messaging profile to retrieve

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

Returns:

See Also:



201
202
203
204
205
206
207
208
209
210
211
# File 'lib/telnyx/resources/messaging_profiles.rb', line 201

def list_phone_numbers(messaging_profile_id, params = {})
  parsed, options = Telnyx::MessagingProfileListPhoneNumbersParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["messaging_profiles/%1$s/phone_numbers", messaging_profile_id],
    query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::PhoneNumberWithMessagingSettings,
    options: options
  )
end

#list_short_codes(messaging_profile_id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ShortCode>

List short codes associated with a messaging profile

Parameters:

  • messaging_profile_id (String)

    The id of the messaging profile to retrieve

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

Returns:

See Also:



228
229
230
231
232
233
234
235
236
237
238
# File 'lib/telnyx/resources/messaging_profiles.rb', line 228

def list_short_codes(messaging_profile_id, params = {})
  parsed, options = Telnyx::MessagingProfileListShortCodesParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["messaging_profiles/%1$s/short_codes", messaging_profile_id],
    query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::ShortCode,
    options: options
  )
end

#retrieve(messaging_profile_id, request_options: {}) ⇒ Telnyx::Models::MessagingProfileRetrieveResponse

Retrieve a messaging profile

Parameters:

  • messaging_profile_id (String)

    The id of the messaging profile to retrieve

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

Returns:

See Also:



73
74
75
76
77
78
79
80
# File 'lib/telnyx/resources/messaging_profiles.rb', line 73

def retrieve(messaging_profile_id, params = {})
  @client.request(
    method: :get,
    path: ["messaging_profiles/%1$s", messaging_profile_id],
    model: Telnyx::Models::MessagingProfileRetrieveResponse,
    options: params[:request_options]
  )
end

#update(messaging_profile_id, alpha_sender: nil, daily_spend_limit: nil, daily_spend_limit_enabled: nil, enabled: nil, mms_fall_back_to_sms: nil, mms_transcoding: nil, mobile_only: nil, name: nil, number_pool_settings: nil, smart_encoding: nil, url_shortener_settings: nil, v1_secret: nil, webhook_api_version: nil, webhook_failover_url: nil, webhook_url: nil, whitelisted_destinations: nil, request_options: {}) ⇒ Telnyx::Models::MessagingProfileUpdateResponse

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

Update a messaging profile

Parameters:

  • messaging_profile_id (String)

    The id of the messaging profile to retrieve

  • alpha_sender (String, nil)

    The alphanumeric sender ID to use when sending to destinations that require an a

  • daily_spend_limit (String)

    The maximum amount of money (in USD) that can be spent by this profile before mi

  • daily_spend_limit_enabled (Boolean)

    Whether to enforce the value configured by ‘daily_spend_limit`.

  • enabled (Boolean)

    Specifies whether the messaging profile is enabled or not.

  • mms_fall_back_to_sms (Boolean)

    enables SMS fallback for MMS messages.

  • mms_transcoding (Boolean)

    enables automated resizing of MMS media.

  • mobile_only (Boolean)

    Send messages only to mobile phone numbers.

  • name (String)

    A user friendly name for the messaging profile.

  • number_pool_settings (Telnyx::Models::NumberPoolSettings, nil)

    Number Pool allows you to send messages from a pool of numbers of different type

  • smart_encoding (Boolean)

    Enables automatic character encoding optimization for SMS messages. When enabled

  • url_shortener_settings (Telnyx::Models::URLShortenerSettings, nil)

    The URL shortener feature allows automatic replacement of URLs that were generat

  • v1_secret (String)

    Secret used to authenticate with v1 endpoints.

  • webhook_api_version (Symbol, Telnyx::Models::MessagingProfileUpdateParams::WebhookAPIVersion)

    Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 201

  • webhook_failover_url (String, nil)

    The failover URL where webhooks related to this messaging profile will be sent i

  • webhook_url (String, nil)

    The URL where webhooks related to this messaging profile will be sent.

  • whitelisted_destinations (Array<String>)

    Destinations to which the messaging profile is allowed to send. The elements in

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

Returns:

See Also:



128
129
130
131
132
133
134
135
136
137
# File 'lib/telnyx/resources/messaging_profiles.rb', line 128

def update(messaging_profile_id, params = {})
  parsed, options = Telnyx::MessagingProfileUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["messaging_profiles/%1$s", messaging_profile_id],
    body: parsed,
    model: Telnyx::Models::MessagingProfileUpdateResponse,
    options: options
  )
end