Project

pamfaxr

0.02
No commit activity in last 3 years
No release in over 3 years
Ruby library for the FaxJob portion of the PamFax API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.5.2
>= 0
~> 2.3.0

Runtime

 Project Readme

PamFaxr

Ruby library for sending faxes via the PamFax Simple API.

Overview

You may send faxes using the PamFax API. See the PamFax Developer page for more details and how to get your developer key.

Requirements

Requires these gems, also in the Gemfile:

* json
* mime-types

Example

# Create a new PamFaxr object

pamfaxr = PamFaxr.new :username => 'your_username', 
                      :password => 'your_password'

# Create a new FaxJob
pamfaxr.create_fax_job

# Add the cover sheet
covers = pamfaxr.list_available_covers
pamfaxr.set_cover(covers['Covers']['content'][1]['id'], 'Foobar is here!')

# Add files
pamfaxr.add_remote_file('https://s3.amazonaws.com/pamfax-test/Tropo.pdf')
pamfaxr.add_file('examples/Tropo.pdf')

# Add a recipient
pamfaxr.add_recipient('+14155551212')

# Loop until the fax is ready to send
loop do
  fax_state = pamfaxr.get_state
  break if fax_state['FaxContainer']['state'] == 'ready_to_send'
  sleep 5
end

# Send the fax
pamfaxr.send_fax