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()
from faxplus import ApiClient, OutboxApi, OutboxComment, RetryOptions, OutboxOptions, OutboxCoverPage, PayloadOutbox, PayloadOutboxFromFax
from faxplus.configuration import Configuration
outbox_comment = OutboxComment(tags=['tag1', 'tag2'], text='text comment')
retry_options = RetryOptions(count=2, delay=15)
outbox_options = OutboxOptions(enhancement=True, retry=retry_options)
outbox_cover_page = OutboxCoverPage(include_company_logo=True)
# Option 1: Send with uploaded files
payload_outbox = PayloadOutbox(
from_number='+12345667',
to=['+12345688', '+12345699'],
files=['filetosend.pdf'],
comment=outbox_comment,
options=outbox_options,
send_time='2000-01-01 01:02:03 +0000',
return_ids=True,
cover_page=outbox_cover_page
)
# Option 2: Resend an existing fax (no file upload needed)
payload_resend = PayloadOutbox(
from_number='+12345667',
to=['+12025559876'],
from_fax=PayloadOutboxFromFax(fax_id='abc123def456')
)
# Option 3: Combine uploaded files + existing fax (files go first)
payload_combined = PayloadOutbox(
from_number='+12345667',
to=['+12345688'],
files=['cover-letter.pdf'],
from_fax=PayloadOutboxFromFax(fax_id='abc123def456'),
options=OutboxOptions(enhancement=False) # Preserve quality
)
conf = Configuration()
conf.access_token = access_token
# header_name and header_value required only when using the OAuth2 token scheme
api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
api = OutboxApi(api_client)
resp = api.send_fax(user_id='13d8z73c', body=payload_outbox)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/outbox");
String jsonBody = ...; // See request body example
String result = Request
.Post(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR CLIENT_ID")
.addHeader("Content-Type", "'application/json'")
.addHeader("Accept", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.bodyString(jsonBody, "application/json")
.execute()
.returnContent().asString();
System.out.println(result.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
// The x-fax-clientid header is required only when using the OAuth2 token scheme
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR CLIENT_ID"}
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/{user_id}/outbox", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
// The x-fax-clientid header is required only when using the OAuth2 token scheme
'x-fax-clientid' => '{client ID}',
);
$client = new GuzzleHttp\Client();
// Define array of request body.
$request_body = ...; // See request body example
try {
$response = $client->request('POST','https://restapi.fax.plus/v3/accounts/{user_id}/outbox', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
# Send with uploaded files
curl -X POST https://restapi.fax.plus/v3/accounts/{user_id}/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12345688", "+12345699"],
"files": ["filetosend.pdf"],
"comment": {"text": "text comment", "tags": ["tag1", "tag2"]},
"options": {"enhancement": true, "retry": {"count": 2, "delay": 15}},
"return_ids": true
}'
# Resend an existing fax (no file upload)
curl -X POST https://restapi.fax.plus/v3/accounts/self/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12025559876"],
"from_fax": {"fax_id": "abc123def456"}
}'
# Combine uploaded files + existing fax
curl -X POST https://restapi.fax.plus/v3/accounts/self/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12345688"],
"files": ["cover-letter.pdf"],
"from_fax": {"fax_id": "abc123def456"},
"options": {"enhancement": false}
}'
{
"ids": {
"+1234567890": "1a2b3c4d5e6f7890",
"+1345678912": "78901a2b3c4d5e6f"
}
}{
"error": "invalid_user_id",
"description": "Invalid user id given"
}{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}Send a fax
Send a fax to one or more destinations. For corporate members without a fax number assigned set the ‘from’ parameter to ‘no_number’. (Permitted scopes: fax:all:edit, fax:fax:edit). To randomly select one of the available numbers per recipient, use comma-separated string.
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()
from faxplus import ApiClient, OutboxApi, OutboxComment, RetryOptions, OutboxOptions, OutboxCoverPage, PayloadOutbox, PayloadOutboxFromFax
from faxplus.configuration import Configuration
outbox_comment = OutboxComment(tags=['tag1', 'tag2'], text='text comment')
retry_options = RetryOptions(count=2, delay=15)
outbox_options = OutboxOptions(enhancement=True, retry=retry_options)
outbox_cover_page = OutboxCoverPage(include_company_logo=True)
# Option 1: Send with uploaded files
payload_outbox = PayloadOutbox(
from_number='+12345667',
to=['+12345688', '+12345699'],
files=['filetosend.pdf'],
comment=outbox_comment,
options=outbox_options,
send_time='2000-01-01 01:02:03 +0000',
return_ids=True,
cover_page=outbox_cover_page
)
# Option 2: Resend an existing fax (no file upload needed)
payload_resend = PayloadOutbox(
from_number='+12345667',
to=['+12025559876'],
from_fax=PayloadOutboxFromFax(fax_id='abc123def456')
)
# Option 3: Combine uploaded files + existing fax (files go first)
payload_combined = PayloadOutbox(
from_number='+12345667',
to=['+12345688'],
files=['cover-letter.pdf'],
from_fax=PayloadOutboxFromFax(fax_id='abc123def456'),
options=OutboxOptions(enhancement=False) # Preserve quality
)
conf = Configuration()
conf.access_token = access_token
# header_name and header_value required only when using the OAuth2 token scheme
api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
api = OutboxApi(api_client)
resp = api.send_fax(user_id='13d8z73c', body=payload_outbox)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/outbox");
String jsonBody = ...; // See request body example
String result = Request
.Post(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR CLIENT_ID")
.addHeader("Content-Type", "'application/json'")
.addHeader("Accept", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.bodyString(jsonBody, "application/json")
.execute()
.returnContent().asString();
System.out.println(result.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
// The x-fax-clientid header is required only when using the OAuth2 token scheme
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR CLIENT_ID"}
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/{user_id}/outbox", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
// The x-fax-clientid header is required only when using the OAuth2 token scheme
'x-fax-clientid' => '{client ID}',
);
$client = new GuzzleHttp\Client();
// Define array of request body.
$request_body = ...; // See request body example
try {
$response = $client->request('POST','https://restapi.fax.plus/v3/accounts/{user_id}/outbox', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
# Send with uploaded files
curl -X POST https://restapi.fax.plus/v3/accounts/{user_id}/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12345688", "+12345699"],
"files": ["filetosend.pdf"],
"comment": {"text": "text comment", "tags": ["tag1", "tag2"]},
"options": {"enhancement": true, "retry": {"count": 2, "delay": 15}},
"return_ids": true
}'
# Resend an existing fax (no file upload)
curl -X POST https://restapi.fax.plus/v3/accounts/self/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12025559876"],
"from_fax": {"fax_id": "abc123def456"}
}'
# Combine uploaded files + existing fax
curl -X POST https://restapi.fax.plus/v3/accounts/self/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12345688"],
"files": ["cover-letter.pdf"],
"from_fax": {"fax_id": "abc123def456"},
"options": {"enhancement": false}
}'
{
"ids": {
"+1234567890": "1a2b3c4d5e6f7890",
"+1345678912": "78901a2b3c4d5e6f"
}
}{
"error": "invalid_user_id",
"description": "Invalid user id given"
}{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}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)
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()
from faxplus import ApiClient, OutboxApi, OutboxComment, RetryOptions, OutboxOptions, OutboxCoverPage, PayloadOutbox, PayloadOutboxFromFax
from faxplus.configuration import Configuration
outbox_comment = OutboxComment(tags=['tag1', 'tag2'], text='text comment')
retry_options = RetryOptions(count=2, delay=15)
outbox_options = OutboxOptions(enhancement=True, retry=retry_options)
outbox_cover_page = OutboxCoverPage(include_company_logo=True)
# Option 1: Send with uploaded files
payload_outbox = PayloadOutbox(
from_number='+12345667',
to=['+12345688', '+12345699'],
files=['filetosend.pdf'],
comment=outbox_comment,
options=outbox_options,
send_time='2000-01-01 01:02:03 +0000',
return_ids=True,
cover_page=outbox_cover_page
)
# Option 2: Resend an existing fax (no file upload needed)
payload_resend = PayloadOutbox(
from_number='+12345667',
to=['+12025559876'],
from_fax=PayloadOutboxFromFax(fax_id='abc123def456')
)
# Option 3: Combine uploaded files + existing fax (files go first)
payload_combined = PayloadOutbox(
from_number='+12345667',
to=['+12345688'],
files=['cover-letter.pdf'],
from_fax=PayloadOutboxFromFax(fax_id='abc123def456'),
options=OutboxOptions(enhancement=False) # Preserve quality
)
conf = Configuration()
conf.access_token = access_token
# header_name and header_value required only when using the OAuth2 token scheme
api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
api = OutboxApi(api_client)
resp = api.send_fax(user_id='13d8z73c', body=payload_outbox)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/outbox");
String jsonBody = ...; // See request body example
String result = Request
.Post(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR CLIENT_ID")
.addHeader("Content-Type", "'application/json'")
.addHeader("Accept", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.bodyString(jsonBody, "application/json")
.execute()
.returnContent().asString();
System.out.println(result.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
// The x-fax-clientid header is required only when using the OAuth2 token scheme
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
"x-fax-clientid": []string{"YOUR CLIENT_ID"}
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/{user_id}/outbox", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
// The x-fax-clientid header is required only when using the OAuth2 token scheme
'x-fax-clientid' => '{client ID}',
);
$client = new GuzzleHttp\Client();
// Define array of request body.
$request_body = ...; // See request body example
try {
$response = $client->request('POST','https://restapi.fax.plus/v3/accounts/{user_id}/outbox', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
# Send with uploaded files
curl -X POST https://restapi.fax.plus/v3/accounts/{user_id}/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12345688", "+12345699"],
"files": ["filetosend.pdf"],
"comment": {"text": "text comment", "tags": ["tag1", "tag2"]},
"options": {"enhancement": true, "retry": {"count": 2, "delay": 15}},
"return_ids": true
}'
# Resend an existing fax (no file upload)
curl -X POST https://restapi.fax.plus/v3/accounts/self/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12025559876"],
"from_fax": {"fax_id": "abc123def456"}
}'
# Combine uploaded files + existing fax
curl -X POST https://restapi.fax.plus/v3/accounts/self/outbox \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: YOUR_CLIENT_ID' \
-d '{
"from": "+12345667",
"to": ["+12345688"],
"files": ["cover-letter.pdf"],
"from_fax": {"fax_id": "abc123def456"},
"options": {"enhancement": false}
}'
Authorizations
OAuth2 Authorization Grant
Path Parameters
User ID. Use 'self' for your own account, or provide a specific user ID for corporate member accounts.
Body
Request to send new outbound fax
Model for creating new outbound fax. Note: At least one of files or from_fax must be provided.
Number to use for sending the fax. Use comma-separated string to randomly select one of the numbers per-recipient
^(([+][0-9]{8,}([*]{0,10}[0-9]+)?)|(no_number)|(NO_NUMBER))(,(([+][0-9]{8,}([*]{0,10}[0-9]+)?)|(no_number)|(NO_NUMBER)))*$"+41782222222,+41782222333,+41782222444"
List of fax destination numbers
1^[+][0-9]{8,}([*]{0,10}[0-9]+)?$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.
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.
Show child attributes
Show child attributes
Comment to set for the fax job
Show child attributes
Show child attributes
Additional configuration for sending a fax
Show child attributes
Show child attributes
Date when to send the fax. Format: YYYY-MM-DD HH:mm:ss +HHMM
^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} [+|-][0-9]{4}Return scheduled fax IDs to use for tracking and with webhooks
Fax resolution. Valid values: fine, superfine
fine, superfine Fax cover page
Show child attributes
Show child attributes
Response
Outbox fax has been created successfully
Send fax handle response, will contain Destination-to-ID mapping if the corresponding flag was provided
Destination-to-ID mapping