Class: Telnyx::Resources::FaxApplications

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/fax_applications.rb

Overview

Fax Applications operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ FaxApplications

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

Parameters:



177
178
179
# File 'lib/telnyx/resources/fax_applications.rb', line 177

def initialize(client:)
  @client = client
end

Instance Method Details

#create(application_name:, webhook_event_url:, active: nil, anchorsite_override: nil, inbound: nil, outbound: nil, tags: nil, webhook_event_failover_url: nil, webhook_timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::FaxApplicationCreateResponse

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

Creates a new Fax Application based on the parameters sent in the request. The application name and webhook URL are required. Once created, you can assign phone numbers to your application using the ‘/phone_numbers` endpoint.

Parameters:

  • application_name (String)

    A user-assigned name to help manage the application.

  • webhook_event_url (String)

    The URL where webhooks related to this connection will be sent. Must include a s

  • active (Boolean)

    Specifies whether the connection can be used.

  • anchorsite_override (Symbol, Telnyx::Models::AnchorsiteOverride)

    ‘Latency` directs Telnyx to route media through the site with the lowest round-t

  • inbound (Telnyx::Models::FaxApplicationCreateParams::Inbound)
  • outbound (Telnyx::Models::FaxApplicationCreateParams::Outbound)
  • tags (Array<String>)

    Tags associated with the Fax Application.

  • webhook_event_failover_url (String, nil)

    The failover URL where webhooks related to this connection will be sent if sendi

  • webhook_timeout_secs (Integer, nil)

    Specifies how many seconds to wait before timing out a webhook.

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

Returns:

See Also:



39
40
41
42
43
44
45
46
47
48
# File 'lib/telnyx/resources/fax_applications.rb', line 39

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

#delete(id, request_options: {}) ⇒ Telnyx::Models::FaxApplicationDeleteResponse

Permanently deletes a Fax Application. Deletion may be prevented if the application is in use by phone numbers.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



165
166
167
168
169
170
171
172
# File 'lib/telnyx/resources/fax_applications.rb', line 165

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

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

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

This endpoint returns a list of your Fax Applications inside the ‘data’ attribute of the response. You can adjust which applications are listed by using filters. Fax Applications are used to configure how you send and receive faxes using the Programmable Fax API with Telnyx.

Parameters:

Returns:

See Also:



140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/telnyx/resources/fax_applications.rb', line 140

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

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::FaxApplicationRetrieveResponse

Return the details of an existing Fax Application inside the ‘data’ attribute of the response.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



62
63
64
65
66
67
68
69
# File 'lib/telnyx/resources/fax_applications.rb', line 62

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

#update(id, application_name:, webhook_event_url:, active: nil, anchorsite_override: nil, fax_email_recipient: nil, inbound: nil, outbound: nil, tags: nil, webhook_event_failover_url: nil, webhook_timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::FaxApplicationUpdateResponse

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

Updates settings of an existing Fax Application based on the parameters of the request.

Parameters:

  • id (String)

    Identifies the resource.

  • application_name (String)

    A user-assigned name to help manage the application.

  • webhook_event_url (String)

    The URL where webhooks related to this connection will be sent. Must include a s

  • active (Boolean)

    Specifies whether the connection can be used.

  • anchorsite_override (Symbol, Telnyx::Models::AnchorsiteOverride)

    ‘Latency` directs Telnyx to route media through the site with the lowest round-t

  • fax_email_recipient (String, nil)

    Specifies an email address where faxes sent to this application will be forwarde

  • inbound (Telnyx::Models::FaxApplicationUpdateParams::Inbound)
  • outbound (Telnyx::Models::FaxApplicationUpdateParams::Outbound)
  • tags (Array<String>)

    Tags associated with the Fax Application.

  • webhook_event_failover_url (String, nil)

    The failover URL where webhooks related to this connection will be sent if sendi

  • webhook_timeout_secs (Integer, nil)

    Specifies how many seconds to wait before timing out a webhook.

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

Returns:

See Also:



106
107
108
109
110
111
112
113
114
115
# File 'lib/telnyx/resources/fax_applications.rb', line 106

def update(id, params)
  parsed, options = Telnyx::FaxApplicationUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["fax_applications/%1$s", id],
    body: parsed,
    model: Telnyx::Models::FaxApplicationUpdateResponse,
    options: options
  )
end