Download the PHP package interfax/interfax without Composer

On this page you can find all versions of the php package interfax/interfax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package interfax

InterFAX PHP Library

PHP versionBuild status

License

Send and receive faxes in PHP with the InterFAX REST API.

Installation

Two versions of this library exist, 1.x and 2.x. The 1.x version provides support for older versions of PHP, whilst the 2.x branch is designed to support the more recent releases of the language:

Package Version Minimum PHP Version Maximum PHP Version
1.x 5.6 7.2
2.x 7.3 8.1

Composer

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:

with 1.x version constraint

or with 2.x version constraint

Download the release

You can download the package in its entirety (from 1.0.2 onward). The Releases page lists all stable versions. Download any file with the name interFAX-PHP-[RELEASE_NAME].zip for a package including this library and its dependencies.

Uncompress the zip file you download, and include the autoloader in your project:

You may wish to rename the release folder to not include the RELEASE_NAME, so that you can drop in future versions without changing the include.

Build it yourself

The installation docs explain how to create a standalone installation.

Getting started

To send a fax for a pdf file:

Usage

Exceptions

Client

The client follows the 12-factor apps principle and can be either set directly or via environment variables.

Send a Fax

To send a fax, call the deliver method on the client with the appropriate array of parameters.

The method will take either a or argument. The is an array of file values.

Each entry can be:

Sending a stream

Because of the high degree of flexibility that PHP stream resources offer, it's not practical to retrieve information automatically from a stream to send as a fax. As such, there are certain required parameters that must be provided:

Note that it is assumed that the stream will not exceed the file size limitation for an inline file to be sent. However, if a size parameter is provided for the stream, and this exceeds the limit, it will be automatically uploaded as a

Documentation

Account

Balance

Determine the remaining faxing credits in your account.

More: documentation

Outbound

Resend fax

has an outbound property that can be accessed:

Get outbound fax list

Options: limit, lastId, sortOrder, userId


Get completed fax list

Get outbound fax record

$client->outbound->find(fax_id)

Retrieves information regarding a previously-submitted fax, including its current status.

Documentation

Get outbound fax image

$client->outbound->find(fax_id)->image()

The image is retrieved via a method on the outbound fax image object.

The fax image format is determined by the settings on the Interfax account being used, as detailed in the Documentation

Cancel an outbound fax

$client->outbound->find(fax_id)->cancel();

A fax is cancelled via a method on the Interfax\Outbound\Fax model.

Search fax list

$client->outbound->search($options)

Search for outbound faxes with a hash array of options keyed by the accepted search parameters for the outbound search API endpoint.

Options: ids, reference, dateFrom, dateTo, status, userId, faxNumber, limit, offset

Resend a Fax

$client->outbound->resend($id[,$newNumber])

Resend the fax identified by the given id (optionally to a new fax number).

Returns a new Interfax\Outbound\Fax representing the newly created outbound fax.

Inbound

Resend to email

has an property that supports the API endpoints for receiving faxes, as described in the Documentation

Get inbound fax list

$inbound->incoming($options = []);

Retrieves a user's list of inbound faxes.

Documentation


Get inbound fax record

$inbound->find($id);

Retrieves a single fax's metadata (receive time, sender number, etc.).

null is returned if the resource is not found. Note that this could be because the user is not permissioned for the specific fax.

Documentation


Get inbound fax image

$inbound->find($id)->image()

The image is retrieved via a method on the inbound fax object.

Documentation


Get forwarding emails

$inbound->find($id)->emails()

The forwarding email details are retrieved via a method on the inbound fax object.

The returned array is a reflection of the values returned from the emails endpoint of the REST API:

Documentation


Mark as read/unread

$inbound->find($id)->markRead(); $inbound->find($id)->markUnread();

The inbound fax object provides methods to change the read status.

Documentation


Resend inbound fax

$inbound->find($id)->resend();

The resend method is on the inbound fax object.


Documents

Cancel

The class allows for the uploading of larger files for faxing. The following is an example of how one should be created:

Create document

Documentation

Upload chunk

Note no verification of data takes place - an exception wil be raised if values do not match appropriately.

Document properties

As per the documentation a Document has a number of properties which are accessible:

Cancel document

$document->cancel(); //returns the $document instance

Can be done prior to completion or afterward

Helper Classes

Outbound Fax

The Interfax\Outbound\Fax class wraps the details of any fax sent, and is returned by most of the methods.

It offers several methods to manage or retrieve information about the fax.

Outbound fax properties

Properties on the Fax vary depending on which method call has been used to create the instance. Requesting a property that has not been received will raise a SPL

Documentation

These are all accessible on a fax instance:

Note values will all be returned as strings.

For convenience, a hash array of the properties can be retrieved

Status should always be available. The values of the status codes are Documented here

Inbound Fax

The incoming equivalent of the outbound fax class, the class wraps the details of any incoming fax, and is returned by the methods where appropriate.

Query parameters

Where methods support a hash array structure of query parameters, these will be passed through to the API endpoint as provided. This ensures that any future parameters that might be added will be supported by the API as is.

The only values that are manipulated are booleans, which will be translated to the text 'TRUE' and 'FALSE' as appropriate.

Documentation

Exceptions

Any method call that involves a call to the Interfax RESTful API may throw an instance of .

An exception is thrown for any requests that do not return a successful HTTP Status code. The goal of this Exception is to provide a convenience wrapper around information that may have been returned.

Certain responses from the API will provide more detail, and where this occurs, it will be appended to the message of the Exception.

Contributing

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

Which version of the library?

Functionality for the API in both versions of the library should be the same, and its therefore intended that the core code continues to be the same in both versions. The differences primarily exist to enable continuity of test coverage as PHP evolves (and phpunit evolves with it)

As such, the core functionality should be developed in a way that will work with PHP 5.6 and up, and be consistent in both versions. Usage of newer language features in PHP will not be accepted in the core code.

Running tests

Ensure that composer is installed, then run the following commands.

License

This library is released under the MIT License.


All versions of interfax with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^7.4|^8
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package interfax/interfax contains the following files

Loading the files please wait ....