Skip to main content
POST
/
accounts
/
{user_id}
/
outbox
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()
{
  "ids": {
    "+1234567890": "1a2b3c4d5e6f7890",
    "+1345678912": "78901a2b3c4d5e6f"
  }
}
You can reuse files from existing faxes using the from_fax parameter instead of uploading files again. This is perfect for:
  • Resending a fax that failed or needs to go to the same destination
  • Forwarding a received fax to new recipients
  • Combining by sending both uploaded files and an existing fax file together (uploaded files are sent first, followed by the file from from_fax)
Set options.enhancement: false when resending to preserve the original quality.
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()

Authorizations

Authorization
string
header
required

OAuth2 Authorization Grant

Path Parameters

user_id
string
default:self
required

User ID. Use 'self' for your own account, or provide a specific user ID for corporate member accounts.

Body

application/json

Request to send new outbound fax

Model for creating new outbound fax. Note: At least one of files or from_fax must be provided.

from
string
required

Number to use for sending the fax. Use comma-separated string to randomly select one of the numbers per-recipient

Example:

"+41782222222,+41782222333,+41782222444"

to
string[]
required

List of fax destination numbers

Minimum array length: 1
files
string[]

List of file names to send. Files should be uploaded beforehand. Required unless from_fax is provided. Can be combined with from_fax to append additional files before the referenced fax file.

from_fax
object

Reference to an existing fax whose file to reuse (resend/forward). Required unless files is provided. Can be combined with files to prepend additional documents before the referenced fax file.

comment
object

Comment to set for the fax job

options
object

Additional configuration for sending a fax

send_time
string

Date when to send the fax. Format: YYYY-MM-DD HH:mm:ss +HHMM

return_ids
boolean
default:false

Return scheduled fax IDs to use for tracking and with webhooks

resolution
enum<string>
default:fine

Fax resolution. Valid values: fine, superfine

Available options:
fine,
superfine
cover_page
object

Fax cover page

Response

Outbox fax has been created successfully

Send fax handle response, will contain Destination-to-ID mapping if the corresponding flag was provided

ids
object

Destination-to-ID mapping