Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby library for accessing the eFax Developer service

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO
Octocat-spinner-32 VERSION
Octocat-spinner-32 efax.gemspec
Octocat-spinner-32 hashrocket-efax.gemspec


Ruby library for accessing the eFax Developer service (

Strange class names and their attribute names come from “eFax Developer Universal User Guide for Outbound Processing” document. You can get it on eFax Developer pages or on Scribd (


Outbound Faxes

First you need to provide your account id and credentials:

EFax::Request.account_id = <your account id>
EFax::Request.user       = <your login>
EFax::Request.password   = <your password>

Sending an HTML page using eFax service is pretty simple:

response =, company_name, fax_number, subject, content)

The response object has the following attributes:

response.doc_id           # unique identifier of your request

See EFax::RequestStatus class for details on status codes.

Having ID of your request, you can get its current status:

response =

The status response has the following attributes:

response.message          # "user friendly" status message

See EFax::QueryStatus class for details on status codes.

Inbound Faxes

Inbound faxes work by exposing a URL that EFax can post to when it receives a fax on your account. An example end-point in rails might look like this:

class InboundFaxesController < AdminController
  def create
    efax = EFax::InboundPostRequest.receive_by_params(params)
    Fax.create(:file => efax.file, :name => # etc
    render :text => efax.post_successful_message # This is important to let EFax know you successfully processed the incoming request.

Test Helpers

You can generate a EFax::InboundPostRequest based on optional explicit fields by using a helper method efax_inbound_post:

In your tests:

require "efax/helpers/inbound_helpers"

describe InboundFax do
  include EFax::Helpers::InboundHelpers

  it "should create a fax from efax data" do
    person = Person.make
    efax = efax_inbound_post(:barcode => person.barcode_number)
    fax = InboundFax.create_from_efax!(efax) 
    fax.person.should == person
Something went wrong with that request. Please try again.