const axios = require('axios');
const FaxesApiFp = require('@alohi/faxplus-api').FaxesApiFp;
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 listFaxes() {
const reqParams = {
"userId": '13d8z73c',
"category": 'inbox',
"after": '2018-01-01 00:00:00',
"before": '2020-01-01 00:00:00',
"limit": '50'
}
const req = await FaxesApiFp(config).listFaxes(reqParams);
const resp = await req(axios);
}
listFaxes()
from faxplus import ApiClient, FaxesApi
from faxplus.configuration import Configuration
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 = FaxesApi(api_client)
resp = api.list_faxes(
user_id='13d8z73c',
category='inbox',
after='2018-01-01 00:00:00',
before='2020-01-01 00:00:00',
limit='50')
/**
* 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}/faxes");
String result = Request
.Get(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR_CLIENT_ID")
.addHeader("Accept", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.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
"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("GET", "https://restapi.fax.plus/v3/accounts/{user_id}/faxes", 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();
try {
$response = $client->request('GET','https://restapi.fax.plus/v3/accounts/{user_id}/faxes', array(
'headers' => $headers,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
# You can also use wget
curl -X GET https://restapi.fax.plus/v3/accounts/{user_id}/faxes \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
# The x-fax-clientid header is required only when using the OAuth2 token scheme
-H 'x-fax-clientid: "YOUR CLIENT_ID"'
{
"data": {
"records": [
{
"comment": "",
"cost": 2,
"cost_details": {
"multiplier": 1,
"notification_cost": 0
},
"description": "OK",
"direction": "incoming",
"duration": 0,
"file": "ec28edc283a74daca1787efb5fa6fae2.tiff",
"file_name": "fax-from-12076001783",
"from_number": "+12076001783",
"header": null,
"id": "5e7de3ad54cfd54eb568cc76",
"is_read": false,
"is_spam": false,
"last_update": "2020-03-27 11:29:49",
"max_retry": null,
"owner_id": "74d59d2779fb42a99cd5bb993c0c89d2",
"pages": 2,
"retry_delay": null,
"scheduled_time": null,
"start_time": "2020-03-27 11:29:21",
"status": "failed",
"submit_time": null,
"to": "+12076001783"
}
]
}
}{
"error": "invalid_user_id",
"description": "Invalid user id given"
}{
"error": "unauthorized",
"description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."
}{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}List fax records
Get your own or your subordinate’s faxes list. (Permitted scopes: fax:all:read, fax:fax:read)
const axios = require('axios');
const FaxesApiFp = require('@alohi/faxplus-api').FaxesApiFp;
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 listFaxes() {
const reqParams = {
"userId": '13d8z73c',
"category": 'inbox',
"after": '2018-01-01 00:00:00',
"before": '2020-01-01 00:00:00',
"limit": '50'
}
const req = await FaxesApiFp(config).listFaxes(reqParams);
const resp = await req(axios);
}
listFaxes()
from faxplus import ApiClient, FaxesApi
from faxplus.configuration import Configuration
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 = FaxesApi(api_client)
resp = api.list_faxes(
user_id='13d8z73c',
category='inbox',
after='2018-01-01 00:00:00',
before='2020-01-01 00:00:00',
limit='50')
/**
* 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}/faxes");
String result = Request
.Get(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR_CLIENT_ID")
.addHeader("Accept", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.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
"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("GET", "https://restapi.fax.plus/v3/accounts/{user_id}/faxes", 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();
try {
$response = $client->request('GET','https://restapi.fax.plus/v3/accounts/{user_id}/faxes', array(
'headers' => $headers,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
# You can also use wget
curl -X GET https://restapi.fax.plus/v3/accounts/{user_id}/faxes \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
# The x-fax-clientid header is required only when using the OAuth2 token scheme
-H 'x-fax-clientid: "YOUR CLIENT_ID"'
{
"data": {
"records": [
{
"comment": "",
"cost": 2,
"cost_details": {
"multiplier": 1,
"notification_cost": 0
},
"description": "OK",
"direction": "incoming",
"duration": 0,
"file": "ec28edc283a74daca1787efb5fa6fae2.tiff",
"file_name": "fax-from-12076001783",
"from_number": "+12076001783",
"header": null,
"id": "5e7de3ad54cfd54eb568cc76",
"is_read": false,
"is_spam": false,
"last_update": "2020-03-27 11:29:49",
"max_retry": null,
"owner_id": "74d59d2779fb42a99cd5bb993c0c89d2",
"pages": 2,
"retry_delay": null,
"scheduled_time": null,
"start_time": "2020-03-27 11:29:21",
"status": "failed",
"submit_time": null,
"to": "+12076001783"
}
]
}
}{
"error": "invalid_user_id",
"description": "Invalid user id given"
}{
"error": "unauthorized",
"description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."
}{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}const axios = require('axios');
const FaxesApiFp = require('@alohi/faxplus-api').FaxesApiFp;
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 listFaxes() {
const reqParams = {
"userId": '13d8z73c',
"category": 'inbox',
"after": '2018-01-01 00:00:00',
"before": '2020-01-01 00:00:00',
"limit": '50'
}
const req = await FaxesApiFp(config).listFaxes(reqParams);
const resp = await req(axios);
}
listFaxes()
from faxplus import ApiClient, FaxesApi
from faxplus.configuration import Configuration
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 = FaxesApi(api_client)
resp = api.list_faxes(
user_id='13d8z73c',
category='inbox',
after='2018-01-01 00:00:00',
before='2020-01-01 00:00:00',
limit='50')
/**
* 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}/faxes");
String result = Request
.Get(url)
// The x-fax-clientid header is required only when using the OAuth2 token scheme
.addHeader("x-fax-clientid", "YOUR_CLIENT_ID")
.addHeader("Accept", "'application/json'")
.addHeader("Authorization", "'Bearer {access-token}'")
.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
"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("GET", "https://restapi.fax.plus/v3/accounts/{user_id}/faxes", 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();
try {
$response = $client->request('GET','https://restapi.fax.plus/v3/accounts/{user_id}/faxes', array(
'headers' => $headers,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
# You can also use wget
curl -X GET https://restapi.fax.plus/v3/accounts/{user_id}/faxes \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
# The x-fax-clientid header is required only when using the OAuth2 token scheme
-H 'x-fax-clientid: "YOUR CLIENT_ID"'
Listing tips
Listing tips
after / before)Both values are UTC (
YYYY-MM-DD HH:MM:SS) and exclusive. To match a local calendar day, convert that day to a UTC window using the correct time zone (daylight-saving rules change the offset).PaginationEach call returns at most 50 records. The JSON body is
data.records only; there is no has_more flag. If you receive 50 records, fetch the next page with offset, or use a narrower time window. Because before is exclusive, records that share the same second as your upper bound are omitted.Categories (default: inbox)- inbox — received faxes that completed or were only partly received; excludes deleted items and user-marked spam (unless you filter by
status). - sent — outgoing faxes.
- spam — spam faxes.
CSV exports from the web app show local time. This API filters on UTC. Convert local days to UTC windows when reconciling with an export.
Authorizations
OAuth2 Authorization Grant
Path Parameters
User ID. Use 'self' for your own account, or provide a specific user ID for corporate member accounts.
Query Parameters
Optional. inbox (default), sent, or spam. See Listing tips below for what each includes.
inbox, sent, spam Optional UTC lower bound (YYYY-MM-DD HH:MM:SS). Exclusive: records on this exact second are not included.
^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}Optional UTC upper bound (YYYY-MM-DD HH:MM:SS). Exclusive: records on this exact second are not included.
^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}Optional. Maximum records per request, 1–50 (default 50). The response does not include a has_more field.
1 <= x <= 50Optional. Number of matching records to skip (default 0). Use with limit for pagination.
0 <= x <= 2147483647Field to sort the results by. Valid values: date, from, to, comment, pages. Optional.
date, from, to, comment, pages Order of the sorting. Valid values: asc for ascending, desc for descending. Optional, defaults to 'asc'.
asc, desc Return in-progress incoming faxes. Optional, defaults to false. This functionality can be enabled on request.
Filter by transmission status. Comma-separated.
See Fax Error Statuses for the full list and meanings.
success, partially_sent, partially_received, in_progress, insufficient_credit, failed, failed_internal_process_error, failed_user_busy, failed_no_answer, failed_unallocated_number, failed_office_converter_issue, failed_separate_file_pages_issue, failed_render_header_issue, failed_invalid_number_format, failed_mimetype_not_supported, failed_destination_not_supported, failed_image_preparation, failed_to_send, failed_origination_unknown, failed_no_origination, failed_no_user_response, failed_call_rejected, failed_exchange_routing_error, failed_no_route_destination, failed_normal_circuit_congestion, failed_recovery_on_timer_expire, failed_requested_chan_unavail, failed_network_out_of_order, failed_destination_out_of_order, failed_normal_temporary_failure, failed_unknown_converter_issue, failed_normal_clearing, failed_convert_to_tiff_issue, failed_fs_2, failed_fs_3, failed_fs_8, failed_fs_9, failed_fs_31, failed_fs_32, failed_fs_35, failed_fs_39, failed_fs_48, failed_fs_49 Filter by source/from fax number in E.164 format
2 - 16^[+][1-9][0-9]{1,14}$Filter by destination/to fax number in E.164 format
2 - 16^[+][1-9][0-9]{1,14}$Filter by read status. true for read faxes, false for unread faxes
Filter faxes with at least this many pages
0 <= x <= 9999Filter faxes with at most this many pages
0 <= x <= 9999Response
Response containing a list of faxes
List of fax data
Show child attributes
Show child attributes