Welcome to the Westfax PHP Demo
The PHP Demo consists of 4 files that demonstrate the use of the WestFax API in PHP. There are comments in the PHP files that document variables and method names. Each of the demo pages contains several highly used API methods, including Authenticate, SendFax and GetFaxStatus. To use the Demo, host the files on a webserver, and then access either the direct.php or indirect.php pages. It will be necessary to obtain credentials from WestFax - you can request this info here: https://westfax.com/developer-registration/. Insert the username, password and producid in the config.php file.
Direct.php - A web page that posts to the Westfax API directly. Notice the Action parameter in each of the forms.
Indirect.php - Presents the same web page as direct.php, but this form posts its data to the server.php file where the API is utilized.
Server.php - This file reads the request from indirect.php, and creates a multipart mime post that gets sent to the WestFax api. The results of the post are displayed in the resulting page. This php file does not use CURL, but manually builds the multipart encoding using native PHP. CURL can be used to make this easier, but not all PHP installations include CURL.
Config.php - Has credentials and product id and urls in one spot for ease of use. Fill this in with your credentials and product Id.