1

Create a Fax.Plus Account

Fax.Plus API is available for enterprise plan only
Please sign up on the Fax.Plus Platform to get started.

2

Get Your API Key

Please visit the Integrations page to get your API key.

3

Upload a file

To send a fax, you need to upload a file to the Fax.Plus server. The file can be in PDF, TIFF, Word, Excel, RTF or image format.

const axios = require('axios');
const fs = require('fs')
const FilesApiFp = require('@alohi/faxplus-api').FilesApiFp;
const Configuration = require('@alohi/faxplus-api').Configuration;

const config = new Configuration({
    accessToken: accessToken,
    basePath: 'https://restapi.fax.plus/v3',
    // Header required only when using the OAuth2 token scheme
    baseOptions: {
        headers: {
          "x-fax-clientid": clientId,
        }
    }
});

async function uploadFile() {
    const reqParams = {
        "format": 'tiff',
        "userId": '13d8z73c',
        "faxFile": fs.createReadStream(FILE_PATH)
    }
    const req = await FilesApiFp(config).uploadFile(reqParams);
    const resp = await req(axios);
}

uploadFile()

Once the file is uploaded, you will receive a path in the response. You will need this path to send a fax.

{
  "path": "/storage/2937237320213-213-21323"
}
4

Send a fax

To send a fax, you need to provide the recipient’s fax number and the file path you received in the previous step.

const axios = require('axios');
const OutboxApiFp = require('@alohi/faxplus-api').OutboxApiFp;
const Configuration = require('@alohi/faxplus-api').Configuration;

const config = new Configuration({
    accessToken: accessToken,
    basePath: 'https://restapi.fax.plus/v3',
    // Header required only when using the OAuth2 token scheme
    baseOptions: {
        headers: {
        "x-fax-clientid": clientId,
        }
    }
});

async function sendFax() {
    const reqParams = {
        "userId": '13d8z73c',
        "payloadOutbox": {
            "comment": {
                "tags": [
                    "tag1",
                    "tag2"
                ],
                "text": "text comment"
            },
            "files": [
                "filetosend.pdf"
            ],
            "from": "+12345667",
            "options": {
                "enhancement": true,
                "retry": {
                    "count": 2,
                    "delay": 15
                }
            },
            "send_time": "2000-01-01 01:02:03 +0000",
            "to": [
                "+12345688",
                "+12345699"
            ],
            "return_ids": true
        }
    }
    const req = await OutboxApiFp(config).sendFax(reqParams);
    const resp = await req(axios);
}

sendFax()

On success, the API will return a response with return a list of fax IDs. Each fax ID represents a fax that was sent to a recipient.

{
  "ids": {
    "+1234567890": "1a2b3c4d5e6f7890",
    "+1345678912": "78901a2b3c4d5e6f"
  }
}

Go further

  • Get notified when the fax status changes with webhooks