Class: Phaxio::Resources::Fax
- Inherits:
-
Phaxio::Resource
- Object
- Phaxio::Resource
- Phaxio::Resources::Fax
- Defined in:
- lib/phaxio/resources/fax.rb
Overview
Provides functionality for viewing and managing faxes.
Defined Under Namespace
Classes: Reference
Instance Attribute Summary collapse
-
#caller_id ⇒ String
For sent faxes only, the number set as the Caller ID when sending the fax.
-
#completed_at ⇒ Time
The time the fax was completed.
-
#cost ⇒ Integer
The cost of the fax in cents.
-
#created_at ⇒ Time
The time the fax was created.
-
#direction ⇒ "sent" | "received"
The direction of the fax.
-
#error_id ⇒ Integer
A numeric error code that corresponds to the error message, if any.
-
#error_message ⇒ String
A more detailed description of what went wrong for a failed fax.
-
#error_type ⇒ String
One of the Phaxio error types.
-
#from_number ⇒ String
For received faxes only, the sender’s E.164 phone number.
-
#id ⇒ Integer
The ID associated with this fax.
-
#is_test ⇒ true | false
An indication of whether or not this is a test fax.
-
#num_pages ⇒ Integer
The number of pages in the fax.
-
#recipients ⇒ Phaxio::Resource::Collection<Phaxio::Resources::FaxRecipient>
A collection of this fax’s recipients.
-
#status ⇒ String
The status of the fax.
-
#tags ⇒ Hash
A hash of tag name and value pairs.
-
#to_number ⇒ String
For received faxes only, the Phaxio phone number that was used to receive the call.
Class Method Summary collapse
-
.cancel(id, params = {}) ⇒ Phaxio::Resources::Fax::Reference
Cancel a fax.
-
.create(params = {}) ⇒ Phaxio::Resources::Fax
(also: send)
Create and send a fax.
-
.delete(id, params = {}) ⇒ true
Delete a fax.
-
.delete_file(id, params = {}) ⇒ true
Delete fax files.
-
.file(id, params = {}) ⇒ File
Get fax content file or thumbnail.
-
.get(id, params = {}) ⇒ Phaxio::Resource::Fax
(also: retrieve, find)
Get fax info.
-
.list(params = {}) ⇒ Phaxio::Resource::Collection<Phaxio::Resources::Fax>
List faxes in date range.
-
.resend(id, params = {}) ⇒ Phaxio::Resources::Fax::Reference
Resend a fax.
-
.test_receive(params = {}) ⇒ true
Test receiving a fax.
Methods inherited from Phaxio::Resource
response_collection, response_record
Instance Attribute Details
#caller_id ⇒ String
Returns for sent faxes only, the number set as the Caller ID when sending the fax.
|
# File 'lib/phaxio/resources/fax.rb', line 27
|
#completed_at ⇒ Time
Returns the time the fax was completed.
71 |
# File 'lib/phaxio/resources/fax.rb', line 71 has_time_attributes %w[created_at completed_at] |
#cost ⇒ Integer
Returns the cost of the fax in cents.
|
# File 'lib/phaxio/resources/fax.rb', line 17
|
#created_at ⇒ Time
Returns the time the fax was created.
|
# File 'lib/phaxio/resources/fax.rb', line 63
|
#direction ⇒ "sent" | "received"
Returns the direction of the fax.
|
# File 'lib/phaxio/resources/fax.rb', line 11
|
#error_id ⇒ Integer
Returns a numeric error code that corresponds to the error message, if any.
|
# File 'lib/phaxio/resources/fax.rb', line 50
|
#error_message ⇒ String
Returns a more detailed description of what went wrong for a failed fax.
|
# File 'lib/phaxio/resources/fax.rb', line 46
|
#error_type ⇒ String
Returns one of the Phaxio error types. Will give you a general idea of what went wrong for a failed fax.
|
# File 'lib/phaxio/resources/fax.rb', line 41
|
#from_number ⇒ String
Returns for received faxes only, the sender’s E.164 phone number.
|
# File 'lib/phaxio/resources/fax.rb', line 32
|
#id ⇒ Integer
Returns the ID associated with this fax.
|
# File 'lib/phaxio/resources/fax.rb', line 8
|
#is_test ⇒ true | false
Returns an indication of whether or not this is a test fax.
|
# File 'lib/phaxio/resources/fax.rb', line 23
|
#num_pages ⇒ Integer
Returns the number of pages in the fax.
|
# File 'lib/phaxio/resources/fax.rb', line 14
|
#recipients ⇒ Phaxio::Resource::Collection<Phaxio::Resources::FaxRecipient>
Returns a collection of this fax’s recipients.
77 |
# File 'lib/phaxio/resources/fax.rb', line 77 has_collection_attributes({recipients: FaxRecipient}) |
#status ⇒ String
Returns the status of the fax.
|
# File 'lib/phaxio/resources/fax.rb', line 20
|
#tags ⇒ Hash
Returns a hash of tag name and value pairs. If a fax was sent with tag metadata, it will appear here.
58 59 60 61 |
# File 'lib/phaxio/resources/fax.rb', line 58 has_normal_attributes %w[ id direction num_pages cost status is_test caller_id from_number to_number error_type error_message error_id tags ] |
#to_number ⇒ String
Returns for received faxes only, the Phaxio phone number that was used to receive the call.
|
# File 'lib/phaxio/resources/fax.rb', line 36
|
Class Method Details
.cancel(id, params = {}) ⇒ Phaxio::Resources::Fax::Reference
Cancel a fax.
195 196 197 198 |
# File 'lib/phaxio/resources/fax.rb', line 195 def cancel id, params = {} response = Client.request :post, cancel_fax_endpoint(id), params response_reference response end |
.create(params = {}) ⇒ Phaxio::Resources::Fax Also known as: send
Create and send a fax.
164 165 166 167 |
# File 'lib/phaxio/resources/fax.rb', line 164 def create params = {} response = Client.request :post, faxes_endpoint, params response_reference response end |
.delete(id, params = {}) ⇒ true
Delete a fax. May only be used with test API credentials.
225 226 227 228 |
# File 'lib/phaxio/resources/fax.rb', line 225 def delete id, params = {} Client.request :delete, fax_endpoint(id), params true end |
.delete_file(id, params = {}) ⇒ true
Delete fax files.
239 240 241 242 |
# File 'lib/phaxio/resources/fax.rb', line 239 def delete_file id, params = {} Client.request :delete, fax_file_endpoint(id), params true end |
.file(id, params = {}) ⇒ File
Get fax content file or thumbnail.
256 257 258 |
# File 'lib/phaxio/resources/fax.rb', line 256 def file id, params = {} Client.request :get, fax_file_endpoint(id), params end |
.get(id, params = {}) ⇒ Phaxio::Resource::Fax Also known as: retrieve, find
Get fax info.
178 179 180 181 |
# File 'lib/phaxio/resources/fax.rb', line 178 def get id, params = {} response = Client.request :get, fax_endpoint(id.to_i), params response_record response end |
.list(params = {}) ⇒ Phaxio::Resource::Collection<Phaxio::Resources::Fax>
This action accepts paging parameters:
-
per_page [Integer] - The maximum number of results to return per call (i.e. “page”). Max 1000.
-
page [Integer] - The page number to return for the request. 1-based.
List faxes in date range.
124 125 126 127 |
# File 'lib/phaxio/resources/fax.rb', line 124 def list params = {} response = Client.request :get, faxes_endpoint, params response_collection response end |
.resend(id, params = {}) ⇒ Phaxio::Resources::Fax::Reference
Resend a fax.
211 212 213 214 |
# File 'lib/phaxio/resources/fax.rb', line 211 def resend id, params = {} response = Client.request :post, resend_fax_endpoint(id), params response_reference response end |
.test_receive(params = {}) ⇒ true
Test receiving a fax. May only be used with test API credentials.
273 274 275 276 |
# File 'lib/phaxio/resources/fax.rb', line 273 def test_receive params = {} Client.request :post, faxes_endpoint, test_receive_params(params) true end |