Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby lib for the PamFax API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 pamfaxr.gemspec
README.md

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
Something went wrong with that request. Please try again.