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"
  }
}
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

self or user id of a corporate member

Body

application/json
Request to send new outbound fax

Model for creating new outbound fax

from
string
required

Number to use for sending the fax

to
string[]
required

List of fax destination numbers

files
string[]
required

List of file names to send. Files should be uploaded beforehand.

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

cover_page
object

Fax cover page

Response

201
application/json
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