node-phaxio
Send faxes with Phaxio. It's completely asynchronous.
If you perfer a promised based api, take a look at our fork phaxio-promise
Installation
npm install phaxio
Usage overview
var Phaxio = phaxio = 'e222........................' '62e5........................' {console;}; phaxio;
Response
success: true message: 'Retrieved fax successfully' data: id: '111111' num_pages: '0' cost: 0 direction: 'sent' status: 'queued' is_test: 'true' requested_at: 1344829113 recipients: number: '13165555555' status: 'queued'
Constructor
new Phaxio(key, secret);
Returns a phaxio object with your keys set on the object.
Methods
phaxio.sendFax(options, callback);
opt = // always required can be an array of a single string to = 'xxxxxxxx' 'xxxxxxxxx' // one of these is required filenames = 'path''path''path' string_data = 'String of data for phaxio to parse' //optional string_data_type: '' batch: "and othe phaxio options" phaxio; phaxio; var batchID;phaxio;
phaxio.cancelFax(faxId, callback)
Cancels the fax faxId
phaxio;
phaxio.faxStatus(faxId, callback)
Returns the status of faxId
phaxio;
phaxio.fireBatch(batchId, callback)
Fires the batch batchId
phaxio;
phaxio.closeBatch(batchId, callback)
Closes the batch batchId
phaxio;
phaxio.provisionNumber(options, callback);
Provisions a number in area code area_code
phaxio;
phaxio.releaseNumber(number, callback)
Releases the number number
phaxio;
phaxio.numberList([options,] callback)
Returns user phone numbers matching optional params area_code
or number
phaxio; phaxio;
phaxio.accountStatus(callback)
Returns the account status
phaxio;
phaxio.testReceive(options, callback)
Simulates receiving a fax containing the PhaxCode in filename
with optional params from_number
and to_number
phaxio; phaxio;
phaxio.attachPhaxCodeToPdf(options, callback)
Returns a PDF of filenames
with a PhaxCode at the x
,y
location specified with optional params metadata
and page_number
phaxio; phaxio;
phaxio.createPhaxCode([options,] callback)
Creates a new PhaxCode with optional metadata
param and returns the URL or returns a PDF if optional redirect
param is true
phaxio; phaxio;
phaxio.getHostedDocument(options, callback)
Returns the hosted document name
with a basic PhaxCode or custom PhaxCode if metadata
is set
phaxio; phaxio;
phaxio.faxFile(options, callback)
Returns the thumbnail or PDF of fax requested, optional type
specifies _p_df (default), _s_mall or _l_arge thumbnail
phaxio; phaxio;
TODO
- Receiving fax callbacks
- Support for faxList
See the issue tracker for more.
Author
Chad Smith (chad@nospam.me). Francis Gulotta (rbrtr.com)
License
This project is UNLICENSED and not endorsed by or affiliated with Phaxio.