NAV
NodeJS SDK Python SDK Java Go PHP cURL HTTP

Fax.Plus REST API v3.0.3

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Fax.Plus API v3 is made for third-party developers and organizations to send and receive faxes from their own software or application.

Fax.Plus programmable API is only available to the users of the Enterprise plan. If you are just getting started, please visit the Fax.Plus official website and the Fax.Plus official help center to learn more about our faxing solution.

Base URL

https://restapi.fax.plus/v3

Latest Swagger spec

https://apidoc.fax.plus/swagger.json

Latest Postman collection

https://apidoc.fax.plus/postman.json

SDKs

Every platform can use the API over HTTP, but we also provide official SDK support for Node.js and Python. If relevant to your use case, using these clients is recommended.

About Alohi

Fax.Plus is developed by Alohi (Geneva, Switzerland).

Authentication

Fax.Plus API offers two methods for authentication:

  1. Personal Access Tokens (PATs) (Recommended)
  2. OAuth2 Authorization Code

Option 1: Personal Access Tokens (PATs)

To generate a new token, visit in your account's dashboard.

Scopes

Personal Access Tokens can be generated with different scopes. Each scope grants access to a specific set of endpoints. The available scopes are:

Personal Access Token Usage

# List corporate members

from faxplus import ApiClient, AccountsApi
from faxplus.configuration import Configuration

conf = Configuration()
conf.access_token = 'alohi_pat_XXXXXXXX'
api_client = ApiClient(configuration=conf)
api = AccountsApi(api_client)
resp = api.get_accounts()
// List corporate members

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

const config = new Configuration({
    accessToken: `alohi_pat_XXXXXXXX`,
    basePath: 'https://restapi.fax.plus/v3',
});

async function getAccounts() {
    const req = await AccountsApiFp(config).getAccounts();
    const resp = await req(axios);
}

getAccounts()
# List corporate members
curl -H "Authorization: Bearer alohi_pat_XXXXXXXX" https://restapi.fax.plus/v3/accounts

You have to include an Authorization header with a value of Bearer YOUR_PERSONAL_ACCESS_TOKEN in every request.


Option 2: OAuth2 Authorization Code

Fax.Plus API also employs the OAuth2 Authorization Code flow for getting and refreshing the authentication token. This flow requires:

It is not required for the redirect URL to be accessible from any place other than user's localhost. For a standalone app it is possible to use a micro HTTP server to get the redirect, fetch the authorization code from it, and shut the server down.

OAuth2 Authorization Code Grant

"""
This example uses requests_oauthlib library and flask
"""

import base64
import os
from threading import Event, Thread

from flask import Flask, request, make_response
from requests_oauthlib import OAuth2Session

CLIENT_ID = 'APIK-MY-CLIENT-ID'
CLIENT_SECRET = 'client-secret'

app = Flask("Auth listener")
authorized = Event()
access_token = None
refresh_token = None
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'  # Due to the redirect URI
oauth = OAuth2Session(client_id=CLIENT_ID, redirect_uri='http://localhost:8080/', scope=['test'])

@app.route('/')
def auth_listener():
    """
    This is the redirect URL listener, here user will be redirected after logging in
    """
    global access_token
    global refresh_token
    global authorized

    token = oauth.fetch_token(
        token_url='https://restapi.fax.plus/token', authorization_response=request.url, include_client_id=True,
        scope=['test'], headers={
            'Authorization': f'Basic {base64.b64encode(f"{CLIENT_ID}:{CLIENT_SECRET}".encode()).decode()}'
        })
    access_token = token['access_token']
    refresh_token = token['refresh_token']
    try:
        return make_response('You can close this tab now', 200)
    finally:
        authorized.set()
        request.environ.get('werkzeug.server.shutdown')()

server = Thread(target=app.run, kwargs={'port': 8080})
server.start()

authorization_url, state = oauth.authorization_url('https://accounts.fax.plus/login')
print(f"Please login at {authorization_url}")
authorized.wait()
server.join()
print(f"Authorized, access token is {access_token}")
const ClientOAuth2 = require('client-oauth2')
const express = require('express')
const app = express()

const auth = new ClientOAuth2({
          clientId: 'MY-CLIENT-ID',
          clientSecret: 'client-secret',
          accessTokenUri: 'https://restapi.fax.plus/token',
          authorizationUri: 'https://accounts.fax.plus/login',
          redirectUri: 'http://localhost:8080/cb/',
          scopes: ['all'],
          body: {'client_id': 'MY-CLIENT-ID'},
          headers: {'Authorization': `Basic ${new Buffer("MY-CLIENT-ID:client-secret").toString("base64")}`}
})

app.get('/', function (req, res) {
  var uri = auth.code.getUri()
  res.redirect(uri)
})

app.get('/cb/', function (req, res) {
  auth.code.getToken(req.originalUrl)
    .then(function (user) {
      console.log(user) //=> { accessToken: '...', tokenType: 'bearer', ... }
      return res.send(user.accessToken)
    })
})

app.listen(8080, () => {
    console.log(`Example app listening at http://localhost:8080`)
})

The first step is to obtain an authorization code.

Redirect the user to the URL https://accounts.fax.plus/login providing the following query parameters:

Let's assume we have http://my.web.app as the registered URI. This URI should be accessible to the user.

https://accounts.fax.plus/login?response_type=code&client_id=CLIENT_ID&redirect_uri=http://my.web.app&scope=all

On the redirected page, the user will be asked to log in and authorize the API. After the permission is granted, the user will be redirected to the given redirect URI with the authorization code as a code query parameter. For example, http://my.web.app?code=XXXXXX

The next step is to obtain an access token. The client must send a HTTP POST request to the base URL https://accounts.fax.plus/token with the following parameters:

Note: when using 3rd party OAuth libraries, ensure that the Authorization header is properly composed, and that the client ID is passed in the request body. Most libraries require additional flags to be set to enable this behavior.

If the request was successful, you will be granted an access token in JSON format.

This token should be passed as a Bearer Token inside the Authorization header with every request.

Refreshing An OAuth2 Access Token

To renew your access token, make an HTTP POST request to the base URL https://accounts.fax.plus/token, passing the refresh token that you have received when obtaining the initial access token as a refresh_token query parameter. Add the grant_type parameter equal to the refresh_token.

https://accounts.fax.plus/token?grant_type=refresh_token&refresh_token=REFRESH_TOKEN

Use the same Authorization header as the one you used for obtaining the access token.

In the response, you will receive the same JSON structure as the one returned when issuing the access token.

The refresh token will remain valid until the user requests a new access token, or revokes the permissions given to the client.

Accounts

getAccounts

Code samples

const axios = require('axios');
const AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
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 getAccounts() {
    const req = await AccountsApiFp(config).getAccounts();
    const resp = await req(axios);
}

getAccounts()

from faxplus import ApiClient, AccountsApi
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 = AccountsApi(api_client)
resp = api.get_accounts()

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

String url = "https://restapi.fax.plus/v3/accounts";

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", 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', 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 \
  -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"'
GET https://restapi.fax.plus/v3/accounts HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts

List corporate members

Get account information of all non-admin members of your corporate account. Only the admin account can send a request to this endpoint which returns the accounts of all members

Example responses

200 Response

{
  "members": [
    {
      "account_data": {
        "company_name": "Company name",
        "default_file_type": "pdf",
        "save_history": true
      },
      "account_type": "corporate_admin",
      "creation_date": "2017-05-06 05:22:21",
      "email": "[email protected]",
      "last_password_modification_date": "2017-05-06 05:22:21",
      "lastname": "Smith",
      "member_of": {},
      "notifications": {
        "black_list": {
          "uids": []
        },
        "settings": {
          "email": {
            "addresses": [
              "[email protected]"
            ],
            "low_credit": true,
            "new_feature": true,
            "receive_fax": true,
            "send_fax": true,
            "voicemail": true
          },
          "language": "fa",
          "push_notifications": {
            "low_credit": true,
            "new_feature": true,
            "receive_fax": true,
            "send_fax": true,
            "voicemail": true
          },
          "sms": {
            "low_credit": true,
            "new_feature": true,
            "numbers": [
              "+16699990000"
            ],
            "receive_fax": true,
            "send_fax": true,
            "voicemail": true
          }
        }
      },
      "phone": "+16699990000",
      "profile_image": "",
      "settings": {
        "caller_id_name": "Fax.Plus",
        "send_fax": {
          "options": {},
          "retry": {
            "count": 0,
            "delay": 0
          },
          "should_enhance": true
        }
      },
      "status": "active",
      "uid": "7724157c0974440293e45877c57f0703"
    }
  ]
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

401 Response

{
  "error": "unauthorized",
  "description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Object containing account information AccountList
400 Bad Request Error object in case there's a problem with given data Error
401 Unauthorized Error object in case there's a problem with the authorization Error
500 Internal Server Error Error object in case there's a server error Error

getUser

Code samples

const axios = require('axios');
const AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
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 getUser() {
    const reqParams = {
        "userId": '473e1eb6'
    }
    const req = await AccountsApiFp(config).getUser(reqParams);
    const resp = await req(axios);
}

getUser()

from faxplus import ApiClient, AccountsApi
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 = AccountsApi(api_client)
resp = api.get_user(
    user_id='473e1eb6')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'473e1eb6'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}");

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}", 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}', 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} \
  -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"'
GET https://restapi.fax.plus/v3/accounts/{user_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}

Get account information

Get information about an account. For members user_id can only be self. For admin it can be either self, or a user_id of any corporate member

Parameters

Name In Type Required Description
user_id path string true User ID to get information about. For your own account use 'self'

Example responses

200 Response

{
  "account_data": {
    "company_name": "Company name",
    "default_file_type": "pdf",
    "save_history": true
  },
  "account_type": "corporate_admin",
  "creation_date": "2017-05-06 05:22:21",
  "email": "[email protected]",
  "last_password_modification_date": "2017-05-06 05:22:21",
  "lastname": "Smith",
  "member_of": {},
  "notifications": {
    "black_list": {
      "uids": []
    },
    "settings": {
      "email": {
        "addresses": [
          "[email protected]"
        ],
        "low_credit": true,
        "new_feature": true,
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      },
      "language": "fa",
      "push_notifications": {
        "low_credit": true,
        "new_feature": true,
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      },
      "sms": {
        "low_credit": true,
        "new_feature": true,
        "numbers": [
          "+16699990000"
        ],
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      }
    }
  },
  "phone": "+16699990000",
  "profile_image": "",
  "settings": {
    "caller_id_name": "Fax.Plus",
    "send_fax": {
      "options": {},
      "retry": {
        "count": 0,
        "delay": 0
      },
      "should_enhance": true
    }
  },
  "status": "active",
  "uid": "7724157c0974440293e45877c57f0703"
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

401 Response

{
  "error": "unauthorized",
  "description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Object containing account information Account
400 Bad Request Error object in case there's a problem with given data Error
401 Unauthorized Error object in case there's a problem with the authorization Error
500 Internal Server Error Error object in case there's a server error Error

updateUser

Code samples

const axios = require('axios');
const AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
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 updateUser() {
    const reqParams = {
        "userId": '473e1eb6',
        "payloadAccountModification": {
            "account_data": {
                "default_file_type": "pdf",
                "save_history": true
            },
            "email": "[email protected]",
            "name": "John",
            "lastname": "Smith",
            "notifications": {
                "black_list": {
                    "uids": []
                },
                "settings": {
                    "email": {
                        "addresses": [
                            "[email protected]"
                        ],
                        "low_credit": true,
                        "new_feature": true,
                        "receive_fax": true,
                        "send_fax": true,
                        "voicemail": true
                    },
                    "language": "en",
                    "push_notifications": {
                        "low_credit": true,
                        "new_feature": true,
                        "receive_fax": true,
                        "send_fax": true,
                        "voicemail": true
                    },
                    "sms": {
                        "low_credit": true,
                        "new_feature": true,
                        "numbers": [
                            "+16699990000"
                        ],
                        "receive_fax": true,
                        "send_fax": true,
                        "voicemail": true
                    }
                }
            },
            "phone": "+16699990000",
            "settings": {
                "caller_id_name": "Fax.Plus",
                "send_fax": {
                    "options": {},
                    "retry": {
                        "count": 0,
                        "delay": 0
                    },
                    "should_enhance": true
                }
            }
        }
    }
    const req = await AccountsApiFp(config).updateUser(reqParams);
    const resp = await req(axios);
}

updateUser()

from faxplus import ApiClient, AccountsApi, \
    AccountData, \
    AccountNotificationsBlacklist, \
    AccountNotificationsEmailSettings, \
    AccountNotificationsPushSettings, \
    AccountNotificationsSlackSettings, \
    AccountNotificationsSmsSettings, \
    AccountNotificationsSettings, \
    AccountNotifications, \
    RetryOptions, \
    AccountSettings, \
    PayloadAccountModification
from faxplus.configuration import Configuration

account_data = AccountData(default_file_type='pdf',
    save_history=True)

account_notifications_blacklist = AccountNotificationsBlacklist(uids=[])

account_notifications_email_settings = AccountNotificationsEmailSettings(addresses=['[email protected]'],
    attachments=dict(),
    low_credit=True,
    new_feature=True,
    receive_fax=True,
    send_fax=True,
    voicemail=True)

account_notifications_push_settings = AccountNotificationsPushSettings(low_credit=True,
    new_feature=True,
    receive_fax=True,
    send_fax=True,
    voicemail=True)

account_notifications_slack_settings = AccountNotificationsSlackSettings()

account_notifications_sms_settings = AccountNotificationsSmsSettings(low_credit=True,
    new_feature=True,
    numbers=['+16699990000'],
    receive_fax=True,
    send_fax=True,
    voicemail=True)

account_notifications_settings = AccountNotificationsSettings(email=account_notifications_email_settings,
    language='en',
    push_notifications=account_notifications_push_settings,
    slack=account_notifications_slack_settings,
    sms=account_notifications_sms_settings)

account_notifications = AccountNotifications(black_list=account_notifications_blacklist,
    settings=account_notifications_settings)

retry_options = RetryOptions(count=0,
    delay=0)

account_settings = AccountSettings(caller_id_name='Fax.Plus',
    options=None,
    send_fax=dict(retry=retry_options))

payload_account_modification = PayloadAccountModification(account_data=account_data,
    email='[email protected]',
    lastname='Smith',
    name='John',
    notifications=account_notifications,
    phone='+16699990000',
    settings=account_settings)

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 = AccountsApi(api_client)
api.update_user(
    user_id='473e1eb6',
    body=payload_account_modification
)

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'473e1eb6'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}");

String jsonBody = ...; // See request body example

String result = Request
    .Put(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("PUT", "https://restapi.fax.plus/v3/accounts/{user_id}", 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('PUT','https://restapi.fax.plus/v3/accounts/{user_id}', 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());
 }

 // ...

# You can also use wget
curl -X PUT https://restapi.fax.plus/v3/accounts/{user_id} \
  -H 'Content-Type: application/json'  \
  -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"'
PUT https://restapi.fax.plus/v3/accounts/{user_id} HTTP/1.1
Host: restapi.fax.plus
Content-Type: application/json
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

PUT /accounts/{user_id}

Modify account information

Modify personal information of your own account or your corporate member's account. user_id can be either self, or a subordinate's user_id

Body parameter

{
  "account_data": {
    "default_file_type": "pdf",
    "save_history": true
  },
  "email": "[email protected]",
  "name": "John",
  "lastname": "Smith",
  "notifications": {
    "black_list": {
      "uids": []
    },
    "settings": {
      "email": {
        "addresses": [
          "[email protected]"
        ],
        "low_credit": true,
        "new_feature": true,
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      },
      "language": "en",
      "push_notifications": {
        "low_credit": true,
        "new_feature": true,
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      },
      "sms": {
        "low_credit": true,
        "new_feature": true,
        "numbers": [
          "+16699990000"
        ],
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      }
    }
  },
  "phone": "+16699990000",
  "settings": {
    "caller_id_name": "Fax.Plus",
    "send_fax": {
      "options": {},
      "retry": {
        "count": 0,
        "delay": 0
      },
      "should_enhance": true
    }
  }
}

Parameters

Name In Type Required Description
user_id path string true User ID to get information about. For your own account use 'self'
body body PayloadAccountModification false Request object for making changes in account

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
204 No Content Modify account information None
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

getMemberDetails

Code samples

const axios = require('axios');
const AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
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 getMemberDetails() {
    const reqParams = {
        "memberUserId": '473e1eb612451s'
    }
    const req = await AccountsApiFp(config).getMemberDetails(reqParams);
    const resp = await req(axios);
}

getMemberDetails()

from faxplus import ApiClient, AccountsApi
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 = AccountsApi(api_client)
resp = api.get_member_details(
    member_user_id='473e1eb612451s')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("member_user_id", "'473e1eb612451s'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/self/member-details/{member_user_id}");

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/self/member-details/{member_user_id}", 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/self/member-details/{member_user_id}', 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/self/member-details/{member_user_id} \
  -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"'
GET https://restapi.fax.plus/v3/accounts/self/member-details/{member_user_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/self/member-details/{member_user_id}

Get member details

Get corporate member's role and faxing quota

Parameters

Name In Type Required Description
member_user_id path string true Member user ID

Example responses

200 Response

{
  "quota": 400,
  "role": "Sales Manager"
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

401 Response

{
  "error": "unauthorized",
  "description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Object containing details of member (quota and role) MemberDetail
400 Bad Request Error object in case there's a problem with given data Error
401 Unauthorized Error object in case there's a problem with the authorization Error
500 Internal Server Error Error object in case there's a server error Error

updateMemberDetails

Code samples

const axios = require('axios');
const AccountsApiFp = require('@alohi/faxplus-api').AccountsApiFp;
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 updateMemberDetails() {
    const reqParams = {
        "memberUserId": '473e1e2fs1b6',
        "memberDetail": {
            "quota": 400,
            "role": "Sales Manager"
        }
    }
    const req = await AccountsApiFp(config).updateMemberDetails(reqParams);
    const resp = await req(axios);
}

updateMemberDetails()

from faxplus import ApiClient, AccountsApi, \
    MemberDetail
from faxplus.configuration import Configuration

member_detail = MemberDetail(quota=400,
    role='Sales Manager')

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 = AccountsApi(api_client)
api.update_member_details(
    member_user_id='473e1e2fs1b6',
    body=member_detail
)

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("member_user_id", "'473e1e2fs1b6'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/self/member-details/{member_user_id}");

String jsonBody = ...; // See request body example

String result = Request
    .Put(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("PUT", "https://restapi.fax.plus/v3/accounts/self/member-details/{member_user_id}", 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('PUT','https://restapi.fax.plus/v3/accounts/self/member-details/{member_user_id}', 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());
 }

 // ...

# You can also use wget
curl -X PUT https://restapi.fax.plus/v3/accounts/self/member-details/{member_user_id} \
  -H 'Content-Type: application/json'  \
  -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"'
PUT https://restapi.fax.plus/v3/accounts/self/member-details/{member_user_id} HTTP/1.1
Host: restapi.fax.plus
Content-Type: application/json
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

PUT /accounts/self/member-details/{member_user_id}

Modify member details

Update corporate member's role and faxing quota

Body parameter

{
  "quota": 400,
  "role": "Sales Manager"
}

Parameters

Name In Type Required Description
member_user_id path string true Member user ID
body body MemberDetail false Request object for making changes in member details

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
204 No Content Modify account information None
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

Numbers

listNumbers

Code samples

const axios = require('axios');
const NumbersApiFp = require('@alohi/faxplus-api').NumbersApiFp;
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 listNumbers() {
    const reqParams = {
        "userId": '23415ufasx8df7'
    }
    const req = await NumbersApiFp(config).listNumbers(reqParams);
    const resp = await req(axios);
}

listNumbers()

from faxplus import ApiClient, NumbersApi
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 = NumbersApi(api_client)
resp = api.list_numbers(
    user_id='23415ufasx8df7')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'23415ufasx8df7'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/numbers");

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}/numbers", 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}/numbers', 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}/numbers \
  -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"'
GET https://restapi.fax.plus/v3/accounts/{user_id}/numbers HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}/numbers

List phone numbers

List your purchased/assigned phone numbers. For corporate members all assigned numbers will be returned, while for the corporate admin, all purchased numbers

Parameters

Name In Type Required Description
user_id path string true ID of the user to get numbers for

Example responses

200 Response

{
  "numbers": [
    {
      "acquired_date": "2017-07-31 09:20:06",
      "assigned_to": [
        "7724157c0974440293e45877c57f0703"
      ],
      "expiration_date": null,
      "id": "e6e68ef87f0b8768ebacdb218994bfe7",
      "is_canceled": false,
      "notifications": [
        {
          "email": true,
          "push_notification": true,
          "type": "voicemail"
        },
        {
          "email": true,
          "push_notification": true,
          "type": "receive_fax"
        },
        {
          "email": true,
          "push_notification": true,
          "type": "announcement"
        },
        {
          "email": true,
          "push_notification": true,
          "type": "callforward"
        }
      ],
      "number": "+16699990000",
      "owner_id": "7724157c0974440293e45877c57f0703",
      "status": "active"
    }
  ]
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Response containing a list of number objects NumberList
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

getNumber

Code samples

const axios = require('axios');
const NumbersApiFp = require('@alohi/faxplus-api').NumbersApiFp;
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 getNumber() {
    const reqParams = {
        "userId": '23415ufasx8df7', 
        "number": '+123417543010'
    }
    const req = await NumbersApiFp(config).getNumber(reqParams);
    const resp = await req(axios);
}

getNumber()

from faxplus import ApiClient, NumbersApi
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 = NumbersApi(api_client)
resp = api.get_number(
    user_id='23415ufasx8df7', 
    number='+123417543010')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'23415ufasx8df7'");
pathParams.put("number", "'+123417543010'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number}");

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}/numbers/{number}", 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}/numbers/{number}', 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}/numbers/{number} \
  -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"'
GET https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}/numbers/{number}

Get number information

Get information about a single purchased/assigned fax number

Parameters

Name In Type Required Description
user_id path string true ID of the number owner
number path string true Fax number to get information about

Example responses

200 Response

{
  "acquired_date": "2017-07-31 09:20:06",
  "assigned_to": [
    "7724157c0974440293e45877c57f0703"
  ],
  "expiration_date": null,
  "id": "e6e68ef87f0b8768ebacdb218994bfe7",
  "is_canceled": false,
  "notifications": [
    {
      "email": true,
      "push_notification": true,
      "type": "voicemail"
    },
    {
      "email": true,
      "push_notification": true,
      "type": "receive_fax"
    },
    {
      "email": true,
      "push_notification": true,
      "type": "announcement"
    },
    {
      "email": true,
      "push_notification": true,
      "type": "callforward"
    }
  ],
  "number": "+16699990000",
  "owner_id": "7724157c0974440293e45877c57f0703",
  "status": "active"
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

404 Response

{
  "error": "bad_request",
  "description": "Requested resource was not found."
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Object containing number information Number
400 Bad Request Error object in case there's a problem with given data Error
404 Not Found Requested resource was not found Error
500 Internal Server Error Error object in case there's a server error Error

updateNumber

Code samples

const axios = require('axios');
const NumbersApiFp = require('@alohi/faxplus-api').NumbersApiFp;
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 updateNumber() {
    const reqParams = {
        "userId": '23415ufasx8df7', 
        "number": '+123417543010',
        "payloadNumberModification": undefined
    }
    const req = await NumbersApiFp(config).updateNumber(reqParams);
    const resp = await req(axios);
}

updateNumber()

from faxplus import ApiClient, NumbersApi, \
    PayloadNumberModification
from faxplus.configuration import Configuration

payload_number_modification = PayloadNumberModification()

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 = NumbersApi(api_client)
api.update_number(
    user_id='23415ufasx8df7', 
    number='+123417543010',
    body=payload_number_modification
)

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'23415ufasx8df7'");
pathParams.put("number", "'+123417543010'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number}");

String jsonBody = ...; // See request body example

String result = Request
    .Put(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("PUT", "https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number}", 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('PUT','https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number}', 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());
 }

 // ...

# You can also use wget
curl -X PUT https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number} \
  -H 'Content-Type: application/json'  \
  -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"'
PUT https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number} HTTP/1.1
Host: restapi.fax.plus
Content-Type: application/json
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

PUT /accounts/{user_id}/numbers/{number}

Assign number

Assign fax number to a corporate member

Body parameter

{
  "assigned_to": "string"
}

Parameters

Name In Type Required Description
user_id path string true ID of the number owner
number path string true Fax number to update
body body PayloadNumberModification false Request object for making changes in number object

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
204 No Content Assign an already purchased number to your members None
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

revokeNumber

Code samples

const axios = require('axios');
const NumbersApiFp = require('@alohi/faxplus-api').NumbersApiFp;
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 revokeNumber() {
    const reqParams = {
        "userId": '23415ufasx8df7', 
        "number": '+123417543010'
    }
    const req = await NumbersApiFp(config).revokeNumber(reqParams);
    const resp = await req(axios);
}

revokeNumber()

from faxplus import ApiClient, NumbersApi
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 = NumbersApi(api_client)
api.revoke_number(
    user_id='23415ufasx8df7', 
    number='+123417543010')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'23415ufasx8df7'");
pathParams.put("number", "'+123417543010'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number}");

String result = Request
    .Delete(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("DELETE", "https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number}", 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('DELETE','https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number}', 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 DELETE https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number} \
  -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"'
DELETE https://restapi.fax.plus/v3/accounts/{user_id}/numbers/{number} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

DELETE /accounts/{user_id}/numbers/{number}

Revoke number

Revoke fax number from a corporate member. To revoke your own number use self as a user_id

Parameters

Name In Type Required Description
user_id path string true ID of the user to revoke the number from. Number can not be removed from the admin
number path string true Fax number to remove members from

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
204 No Content Revoke number from member that owns fax number None
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

Faxes

listFaxes

Code samples

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"'
GET https://restapi.fax.plus/v3/accounts/{user_id}/faxes HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}/faxes

List fax records

Get your own or your subordinate's faxes list

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
category query FaxCategory false Category parameter. Valid values: inbox, sent, spam
after query string false Start date to get records from that date. Format: YYYY-MM-DD HH:mm:ss
before query string false End date to get records before that date. Format: YYYY-MM-DD HH:mm:ss
limit query integer false Limit of fax records you want to get per request

Enumerated Values

Parameter Value
category inbox
category sent
category spam

Example responses

200 Response

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

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Response containing a list of faxes FaxList
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

getFax

Code samples

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 getFax() {
    const reqParams = {
        "userId": '13d8z73c', 
        "faxId": '132esd4cs31'
    }
    const req = await FaxesApiFp(config).getFax(reqParams);
    const resp = await req(axios);
}

getFax()

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.get_fax(
    user_id='13d8z73c', 
    fax_id='132esd4cs31')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
pathParams.put("fax_id", "'132esd4cs31'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id}");

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/{fax_id}", 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/{fax_id}', 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/{fax_id} \
  -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"'
GET https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}/faxes/{fax_id}

Get a fax record

Get a specific fax record details like duration, pages etc.

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
fax_id path string true none

Example responses

200 Response

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

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

404 Response

{
  "error": "bad_request",
  "description": "Requested resource was not found."
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Response containing a single fax object Fax
400 Bad Request Error object in case there's a problem with given data Error
404 Not Found Requested resource was not found Error
500 Internal Server Error Error object in case there's a server error Error

updateFax

Code samples

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 updateFax() {
    const reqParams = {
        "userId": '13d8z73c', 
        "faxId": '132esd4cs31',
        "payloadFaxModification": undefined
    }
    const req = await FaxesApiFp(config).updateFax(reqParams);
    const resp = await req(axios);
}

updateFax()

from faxplus import ApiClient, FaxesApi, \
    PayloadFaxModification
from faxplus.configuration import Configuration

payload_fax_modification = PayloadFaxModification()

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)
api.update_fax(
    user_id='13d8z73c', 
    fax_id='132esd4cs31',
    body=payload_fax_modification
)

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
pathParams.put("fax_id", "'132esd4cs31'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id}");

String jsonBody = ...; // See request body example

String result = Request
    .Put(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("PUT", "https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id}", 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('PUT','https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id}', 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());
 }

 // ...

# You can also use wget
curl -X PUT https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id} \
  -H 'Content-Type: application/json'  \
  -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"'
PUT https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id} HTTP/1.1
Host: restapi.fax.plus
Content-Type: application/json
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

PUT /accounts/{user_id}/faxes/{fax_id}

Modify fax record

You can modify a fax record's comment or mark it as read

Body parameter

{
  "comment": "string",
  "is_read": true
}

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
fax_id path string true none
body body PayloadFaxModification false Request object for making changes in a fax object

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
204 No Content Fax updated successfully None
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

deleteFax

Code samples

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 deleteFax() {
    const reqParams = {
        "userId": '13d8z73c', 
        "faxId": '132esd4cs31'
    }
    const req = await FaxesApiFp(config).deleteFax(reqParams);
    const resp = await req(axios);
}

deleteFax()

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)
api.delete_fax(
    user_id='13d8z73c', 
    fax_id='132esd4cs31')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
pathParams.put("fax_id", "'132esd4cs31'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id}");

String result = Request
    .Delete(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("DELETE", "https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id}", 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('DELETE','https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id}', 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 DELETE https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id} \
  -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"'
DELETE https://restapi.fax.plus/v3/accounts/{user_id}/faxes/{fax_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

DELETE /accounts/{user_id}/faxes/{fax_id}

Delete a fax

Delete a specific fax record by providing its id

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
fax_id path string true none

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

404 Response

{
  "error": "bad_request",
  "description": "Requested resource was not found."
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
204 No Content 204 will be return on successful CDR modification None
400 Bad Request Error object in case there's a problem with given data Error
404 Not Found Requested resource was not found Error
500 Internal Server Error Error object in case there's a server error Error

Response Schema

Files

uploadFile

Code samples

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()

from faxplus import ApiClient, FilesApi
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 = FilesApi(api_client)
resp = api.upload_file(
    format='tiff', 
    user_id='13d8z73c',
    fax_file='/path/to/file.pdf'
)

/**
 * 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}/files");

HttpEntity entity = MultipartEntityBuilder.create()
        .setMode(HttpMultipartMode.BROWSER_COMPATIBLE)
        .setCharset(Charset.forName(CHARSET))
        .addBinaryBody("fax_file", bytes, ContentType.MULTIPART_FORM_DATA, "fax.pdf")
        .build();

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", "'multipart/form-data'")
    .addHeader("Accept", "'application/json'")
    .addHeader("Authorization", "'Bearer {access-token}'")
    .body(entity)
    .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{"multipart/form-data"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-fax-clientid": []string{"YOUR_CLIENT_ID"}
    }

    body := &bytes.Buffer{}
    writer := multipart.NewWriter(body)
    fax_file_part, err := writer.CreateFormFile('fax_file', filepath.Base('fax.pdf'))
    _, err = io.Copy(part, file)

    req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/{user_id}/files", 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('POST','https://restapi.fax.plus/v3/accounts/{user_id}/files', array(
        'headers' => $headers,
        'multipart' => [
          [
            'name' => 'fax_file',
            'contents' => fopen('fax.pdf', 'r')
          ],
        ],)
    );
    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 POST https://restapi.fax.plus/v3/accounts/{user_id}/files \
  -H 'Content-Type: multipart/form-data'  \
  -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"' \
  -F '[email protected]'
POST https://restapi.fax.plus/v3/accounts/{user_id}/files HTTP/1.1
Host: restapi.fax.plus
Content-Type: multipart/form-data; boundary=--boundary.7d7322aa8894013e
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

--boundary.7d7322aa8894013e
Content-Disposition: form-data; name="fax_file"; filename="fax.pdf"
Content-Type: .....
{RAW_BINARY_DATA}
--boundary.7d7322aa8894013e--

POST /accounts/{user_id}/files

Upload a file

Before sending a fax you need to upload your files using this API. In order to upload your fax file, you have to send a multipart/form-data request with your file. Set the name to fax_file, filename to your file's name with extension, and the Content-Type to the file's MIME type. In most cases, the filename directive will be automatically added by your library of choice. If the upload was successful you would receive a file_path which you can use to send your fax.

Body parameter

fax_file: fax.pdf

Parameters

Name In Type Required Description
format query FileType false Can be 'pdf' or 'tiff'
user_id path string true self or user id of a corporate member
body body File false A file to be uploaded

Enumerated Values

Parameter Value
format tiff
format pdf

Example responses

201 Response

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

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
201 Created Simple object containing path of created file FilePath
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

getFile

Code samples

const axios = require('axios');
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 getFile() {
    const reqParams = {
        "userId": '13d8z73c', 
        "faxId": '132esd4cs31', 
        "format": 'tiff'
    }
    const req = await FilesApiFp(config).getFile(reqParams);
    const resp = await req(axios);
}

getFile()

from faxplus import ApiClient, FilesApi
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 = FilesApi(api_client)
resp = api.get_file(
    user_id='13d8z73c', 
    fax_id='132esd4cs31', 
    format='tiff')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
pathParams.put("fax_id", "'132esd4cs31'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/files/{fax_id}");

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/pdf'")
    .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/pdf"},
        "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}/files/{fax_id}", 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}/files/{fax_id}', 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}/files/{fax_id} \
  -H 'Accept: application/pdf'  \
  -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"'
GET https://restapi.fax.plus/v3/accounts/{user_id}/files/{fax_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/pdf
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}/files/{fax_id}

Download fax file

Download sent or received fax file

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
fax_id path string true ID of the fax which you want to download
format query FileType false This parameter overrides the Accept header

Enumerated Values

Parameter Value
format tiff
format pdf

Example responses

200 Response

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK CDR file content in corresponding mimetype e.g. application/pdf Binary
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

getFaxReport

Code samples

const axios = require('axios');
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 getFaxReport() {
    const reqParams = {
        "userId": '13d8z73c', 
        "faxId": '132esd4cs31'
    }
    const req = await FilesApiFp(config).getFaxReport(reqParams);
    const resp = await req(axios);
}

getFaxReport()

from faxplus import ApiClient, FilesApi
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 = FilesApi(api_client)
resp = api.get_fax_report(
    user_id='13d8z73c', 
    fax_id='132esd4cs31')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
pathParams.put("fax_id", "'132esd4cs31'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/report/{fax_id}");

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/pdf'")
    .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/pdf"},
        "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}/report/{fax_id}", 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}/report/{fax_id}', 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}/report/{fax_id} \
  -H 'Accept: application/pdf'  \
  -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"'
GET https://restapi.fax.plus/v3/accounts/{user_id}/report/{fax_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/pdf
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}/report/{fax_id}

Get fax confirmation report

Retrieve fax confirmation report

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
fax_id path string true ID of the fax which you want to download

Example responses

200 Response

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Confirmation fax report in PDF Binary
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

Outbox

listOutboxFaxes

Code samples

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 listOutboxFaxes() {
    const reqParams = {
        "userId": '13d8z73c'
    }
    const req = await OutboxApiFp(config).listOutboxFaxes(reqParams);
    const resp = await req(axios);
}

listOutboxFaxes()

from faxplus import ApiClient, OutboxApi
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 = OutboxApi(api_client)
resp = api.list_outbox_faxes(
    user_id='13d8z73c')

/**
 * 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 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}/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();

try {
    $response = $client->request('GET','https://restapi.fax.plus/v3/accounts/{user_id}/outbox', 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}/outbox \
  -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"'
GET https://restapi.fax.plus/v3/accounts/{user_id}/outbox HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}/outbox

List faxes in the outbox

Get a list of the faxes in the outbox which were not yet sent

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member

Example responses

200 Response

{
  "records": [
    {
      "comment": {
        "tags": [],
        "text": ""
      },
      "contact_name": "",
      "designated_src": "",
      "extra_info": {},
      "file_changes": [],
      "files": [
        "/transient-29362c0c-eeff-45c1-9f4e-4ef5865a41df"
      ],
      "id": "13a4afb0585345639733857e8f36df8d",
      "initiated_from": {
        "from_id": "",
        "type": ""
      },
      "ip": "8.8.8.8",
      "last_updated_status_time": "2017-09-24 06:43:04",
      "options": {},
      "page_count": 0,
      "retry": {
        "count": 0,
        "delay": 0
      },
      "send_time": "2017-09-24 06:43:04 +0000",
      "should_enhance": false,
      "src": "+16699990000",
      "status": "submitted",
      "status_changes": [
        {
          "at": "2017-09-24 06:43:04",
          "status": "submitted"
        }
      ],
      "submit_time": "2017-09-24 06:43:04 +0000",
      "to": [
        "+16699990000"
      ],
      "uid": "53a1afb8585345a39033857e1f36bf8d"
    }
  ]
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Response containing a list of faxes waiting to be sent OutboxList
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

sendFax

Code samples

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
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()

payload_outbox = PayloadOutbox(from='+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)

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());
 }

 // ...

# You can also use wget
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}' \
  # The x-fax-clientid header is required only when using the OAuth2 token scheme
  -H 'x-fax-clientid: "YOUR_CLIENT_ID"'
POST https://restapi.fax.plus/v3/accounts/{user_id}/outbox HTTP/1.1
Host: restapi.fax.plus
Content-Type: application/json
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

POST /accounts/{user_id}/outbox

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'

Body parameter

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

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
body body PayloadOutbox false Request to send new outbound fax

Example responses

201 Response

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

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
201 Created Outbox fax has been created successfully SendFaxResponse
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

getOutboxFax

Code samples

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 getOutboxFax() {
    const reqParams = {
        "userId": '13d8z73c', 
        "outboxFaxId": '132esd4cs31'
    }
    const req = await OutboxApiFp(config).getOutboxFax(reqParams);
    const resp = await req(axios);
}

getOutboxFax()

from faxplus import ApiClient, OutboxApi
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 = OutboxApi(api_client)
resp = api.get_outbox_fax(
    user_id='13d8z73c', 
    outbox_fax_id='132esd4cs31')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
pathParams.put("outbox_fax_id", "'132esd4cs31'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id}");

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}/outbox/{outbox_fax_id}", 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}/outbox/{outbox_fax_id}', 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}/outbox/{outbox_fax_id} \
  -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"'
GET https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /accounts/{user_id}/outbox/{outbox_fax_id}

List outgoing faxes

Get a list of faxes currently scheduled for sending

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
outbox_fax_id path string true ID of the outgoing fax to get

Example responses

200 Response

{
  "comment": {
    "tags": [],
    "text": ""
  },
  "contact_name": "",
  "designated_src": "",
  "extra_info": {},
  "file_changes": [],
  "files": [
    "/transient-29362c0c-eeff-45c1-9f4e-4ef5865a41df"
  ],
  "id": "13a4afb0585345639733857e8f36df8d",
  "initiated_from": {
    "from_id": "",
    "type": ""
  },
  "ip": "8.8.8.8",
  "last_updated_status_time": "2017-09-24 06:43:04",
  "options": {},
  "page_count": 0,
  "retry": {
    "count": 0,
    "delay": 0
  },
  "send_time": "2017-09-24 06:43:04 +0000",
  "should_enhance": false,
  "src": "+16699990000",
  "status": "submitted",
  "status_changes": [
    {
      "at": "2017-09-24 06:43:04",
      "status": "submitted"
    }
  ],
  "submit_time": "2017-09-24 06:43:04 +0000",
  "to": [
    "+16699990000"
  ],
  "uid": "53a1afb8585345a39033857e1f36bf8d"
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Response containing a single outbox object Outbox
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

deleteOutboxFax

Code samples

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 deleteOutboxFax() {
    const reqParams = {
        "userId": '13d8z73c', 
        "outboxFaxId": '132esd4cs31'
    }
    const req = await OutboxApiFp(config).deleteOutboxFax(reqParams);
    const resp = await req(axios);
}

deleteOutboxFax()

from faxplus import ApiClient, OutboxApi
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 = OutboxApi(api_client)
api.delete_outbox_fax(
    user_id='13d8z73c', 
    outbox_fax_id='132esd4cs31')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
pathParams.put("outbox_fax_id", "'132esd4cs31'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id}");

String result = Request
    .Delete(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("DELETE", "https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id}", 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('DELETE','https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id}', 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 DELETE https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id} \
  -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"'
DELETE https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

DELETE /accounts/{user_id}/outbox/{outbox_fax_id}

Delete an outgoing fax

Delete an outgoing fax that is being scheduled for sending

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
outbox_fax_id path string true ID of the outgoing fax to delete

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
204 No Content 204 will be returned on successful fax deletion from outbox None
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

updateOutboxFax

Code samples

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 updateOutboxFax() {
    const reqParams = {
        "userId": '13d8z73c', 
        "outboxFaxId": '132esd4cs31',
        "payloadOutboxModification": undefined
    }
    const req = await OutboxApiFp(config).updateOutboxFax(reqParams);
    const resp = await req(axios);
}

updateOutboxFax()

from faxplus import ApiClient, OutboxApi, \
    PayloadOutboxModification
from faxplus.configuration import Configuration

payload_outbox_modification = PayloadOutboxModification()

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)
api.update_outbox_fax(
    user_id='13d8z73c', 
    outbox_fax_id='132esd4cs31',
    body=payload_outbox_modification
)

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("user_id", "'13d8z73c'");
pathParams.put("outbox_fax_id", "'132esd4cs31'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id}");

String jsonBody = ...; // See request body example

String result = Request
    .Put(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("PUT", "https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id}", 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('PUT','https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id}', 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());
 }

 // ...

# You can also use wget
curl -X PUT https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id} \
  -H 'Content-Type: application/json'  \
  -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"'
PUT https://restapi.fax.plus/v3/accounts/{user_id}/outbox/{outbox_fax_id} HTTP/1.1
Host: restapi.fax.plus
Content-Type: application/json
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

PUT /accounts/{user_id}/outbox/{outbox_fax_id}

Modify an outgoing fax

Modify an outgoing fax that is being scheduled for sending

Body parameter

{
  "comment": "string"
}

Parameters

Name In Type Required Description
user_id path string true self or user id of a corporate member
outbox_fax_id path string true ID of the outgoing fax to update
body body PayloadOutboxModification false Request object for making changes in an outbox object

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
204 No Content 204 will be returned on successful fax modification in outbox None
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

Webhooks

getWebhooks

Code samples

const axios = require('axios');
const WebhooksApiFp = require('@alohi/faxplus-api').WebhooksApiFp;
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 getWebhooks() {
    const reqParams = {
        "event": 'fax_received'
    }
    const req = await WebhooksApiFp(config).getWebhooks(reqParams);
    const resp = await req(axios);
}

getWebhooks()

from faxplus import ApiClient, WebhooksApi
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 = WebhooksApi(api_client)
resp = api.get_webhooks(
    event='fax_received')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

String url = "https://restapi.fax.plus/v3/hooks?event=fax_received";

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/hooks", 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/hooks', 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/hooks?event=fax_received \
  -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"'
GET https://restapi.fax.plus/v3/hooks?event=fax_received HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

GET /hooks

List user webhooks

Returns a list of currently registered webhooks for the requested event

Parameters

Name In Type Required Description
event query WebhookEventType true none

Enumerated Values

Parameter Value
event fax_received
event fax_sent

Example responses

200 Response

{
  "data": [
    {
      "target": "http://myapp.com/fax_received",
      "event": "fax_received"
    }
  ]
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Response containing a list of currently registered webhooks WebhookList
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

createWebhook

Code samples

const axios = require('axios');
const WebhooksApiFp = require('@alohi/faxplus-api').WebhooksApiFp;
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 createWebhook() {
    const reqParams = {,
        "webhook": {
            "target": "http://myapp.com/fax_received",
            "event": "fax_received"
        }
    }
    const req = await WebhooksApiFp(config).createWebhook(reqParams);
    const resp = await req(axios);
}

createWebhook()

from faxplus import ApiClient, WebhooksApi, \
    Webhook
from faxplus.configuration import Configuration

webhook = Webhook(target='http://myapp.com/fax_received',
    event='fax_received')

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 = WebhooksApi(api_client)
resp = api.create_webhook(,
    body=webhook
)

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

String url = "https://restapi.fax.plus/v3/hooks";

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/hooks", 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/hooks', 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());
 }

 // ...

# You can also use wget
curl -X POST https://restapi.fax.plus/v3/hooks \
  -H 'Content-Type: application/json'  \
  -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"'
POST https://restapi.fax.plus/v3/hooks HTTP/1.1
Host: restapi.fax.plus
Content-Type: application/json
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

POST /hooks

Register new webhook

Register a new webhook which will be called on a specific event. See the WebhookCallback model

Body parameter

{
  "target": "http://myapp.com/fax_received",
  "event": "fax_received"
}

Parameters

Name In Type Required Description
body body Webhook false Request to create new webhook

Example responses

200 Response

{
  "id": "6048b47181dbe1a7d67fcc98"
}

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Webhook ID WebhookId
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

deleteWebhook

Code samples

const axios = require('axios');
const WebhooksApiFp = require('@alohi/faxplus-api').WebhooksApiFp;
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 deleteWebhook() {
    const reqParams = {
        "hookId": '4d5331f94a00460d811c2f2ac64ae20b'
    }
    const req = await WebhooksApiFp(config).deleteWebhook(reqParams);
    const resp = await req(axios);
}

deleteWebhook()

from faxplus import ApiClient, WebhooksApi
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 = WebhooksApi(api_client)
api.delete_webhook(
    hook_id='4d5331f94a00460d811c2f2ac64ae20b')

/**
 * Example below uses Apache HTTP Client 4 with Fluent API
 **/

Map<String, String> pathParams = new HashMap<>();
pathParams.put("hook_id", "'4d5331f94a00460d811c2f2ac64ae20b'");

StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
String url = sub.replace("https://restapi.fax.plus/v3/hooks/{hook_id}");

String result = Request
    .Delete(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("DELETE", "https://restapi.fax.plus/v3/hooks/{hook_id}", 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('DELETE','https://restapi.fax.plus/v3/hooks/{hook_id}', 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 DELETE https://restapi.fax.plus/v3/hooks/{hook_id} \
  -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"'
DELETE https://restapi.fax.plus/v3/hooks/{hook_id} HTTP/1.1
Host: restapi.fax.plus
Accept: application/json
x-fax-clientid: YOUR_CLIENT_ID # Required only when using the OAuth2 token scheme

DELETE /hooks/{hook_id}

Delete webhook

Delete a webhook by its ID

Parameters

Name In Type Required Description
hook_id path string true ID of the webhook to delete

Example responses

400 Response

{
  "error": "invalid_user_id",
  "description": "Invalid user id given"
}

500 Response

{
  "error": "internal_server_error",
  "description": "An unexpected error happened, please contact support"
}

Responses

Status Meaning Description Schema
200 OK Webhook was successfully deleted None
400 Bad Request Error object in case there's a problem with given data Error
500 Internal Server Error Error object in case there's a server error Error

Schemas

Account

{
  "account_data": {
    "company_name": "Company name",
    "default_file_type": "pdf",
    "save_history": true
  },
  "account_type": "corporate_admin",
  "creation_date": "2017-05-06 05:22:21",
  "email": "[email protected]",
  "last_password_modification_date": "2017-05-06 05:22:21",
  "lastname": "Smith",
  "member_of": {},
  "notifications": {
    "black_list": {
      "uids": []
    },
    "settings": {
      "email": {
        "addresses": [
          "[email protected]"
        ],
        "low_credit": true,
        "new_feature": true,
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      },
      "language": "fa",
      "push_notifications": {
        "low_credit": true,
        "new_feature": true,
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      },
      "sms": {
        "low_credit": true,
        "new_feature": true,
        "numbers": [
          "+16699990000"
        ],
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      }
    }
  },
  "phone": "+16699990000",
  "profile_image": "",
  "settings": {
    "caller_id_name": "Fax.Plus",
    "send_fax": {
      "options": {},
      "retry": {
        "count": 0,
        "delay": 0
      },
      "should_enhance": true
    }
  },
  "status": "active",
  "uid": "7724157c0974440293e45877c57f0703"
}

User account model

Properties

Name Type Required Description Restrictions
account_data AccountData none none
account_type AccountType * Account type which could be corporate_admin, individual, etc none
creation_date string * Creation date in UTC. Format: YYYY-MM-DD HH:mm:ss Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}
email string * Account email address Pattern: ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$
last_password_modification_date string The date on which you have changed your password none
lastname string Your last name none
member_of [string] List of user ids that you are member of. none
name string Your first name none
notifications AccountNotifications Account notification settings none
phone string Your account phone number Pattern: ^[+]?[0-9]{8,}$
profile_image string Profile image path none
settings AccountSettings Account settings none
status AccountStatus * Your account status which could be active, inactive etc none
uid string * User ID of current user none

AccountData

{
  "company_logo": "string",
  "company_name": "string",
  "deactivation_reason": "string",
  "default_file_type": "tiff",
  "role": "string",
  "save_history": true
}

Properties

Name Type Required Description Restrictions
company_logo string File name of your company logo none
company_name string Your company name in case you are a corporate admin none
deactivation_reason string none none
default_file_type FileType File type none
role string Role of the account in the company none
save_history boolean Save fax CDRs in inbox status none

AccountSettings

{
  "caller_id_name": "string",
  "options": {},
  "send_fax": {
    "retry": {
      "retry": {
        "count": 2,
        "delay": 10
      }
    }
  },
  "should_enhance": true
}

Account settings

Properties

Name Type Required Description Restrictions
caller_id_name string Account caller id name none
options object none none
send_fax object none none
» retry RetryOptions Fax retry settings none
should_enhance boolean none none

AccountList

{
  "members": [
    {
      "account_data": {
        "company_name": "Company name",
        "default_file_type": "pdf",
        "save_history": true
      },
      "account_type": "corporate_admin",
      "creation_date": "2017-05-06 05:22:21",
      "email": "[email protected]",
      "last_password_modification_date": "2017-05-06 05:22:21",
      "lastname": "Smith",
      "member_of": {},
      "notifications": {
        "black_list": {
          "uids": []
        },
        "settings": {
          "email": {
            "addresses": [
              "[email protected]"
            ],
            "low_credit": true,
            "new_feature": true,
            "receive_fax": true,
            "send_fax": true,
            "voicemail": true
          },
          "language": "fa",
          "push_notifications": {
            "low_credit": true,
            "new_feature": true,
            "receive_fax": true,
            "send_fax": true,
            "voicemail": true
          },
          "sms": {
            "low_credit": true,
            "new_feature": true,
            "numbers": [
              "+16699990000"
            ],
            "receive_fax": true,
            "send_fax": true,
            "voicemail": true
          }
        }
      },
      "phone": "+16699990000",
      "profile_image": "",
      "settings": {
        "caller_id_name": "Fax.Plus",
        "send_fax": {
          "options": {},
          "retry": {
            "count": 0,
            "delay": 0
          },
          "should_enhance": true
        }
      },
      "status": "active",
      "uid": "7724157c0974440293e45877c57f0703"
    }
  ]
}

List of user accounts

Properties

Name Type Required Description Restrictions
members [Account] * [User account model] none

AccountNotifications

{
  "black_list": {
    "uids": [
      "string"
    ]
  },
  "settings": {
    "email": {
      "addresses": [
        "string"
      ],
      "attachments": {
        "confirmation_page": true,
        "receive_fax": true,
        "send_fax": true
      },
      "low_credit": true,
      "new_feature": true,
      "receive_fax": true,
      "send_fax": true,
      "voicemail": true
    },
    "language": "en",
    "push_notifications": {
      "low_credit": true,
      "new_feature": true,
      "receive_fax": true,
      "send_fax": true,
      "voicemail": true
    },
    "slack": {
      "receive_fax": "with_attachment",
      "send_fax": "with_attachment",
      "target_channel": "string"
    },
    "sms": {
      "low_credit": true,
      "new_feature": true,
      "numbers": [
        "string"
      ],
      "receive_fax": true,
      "send_fax": true,
      "voicemail": true
    }
  }
}

Account notification settings

Properties

Name Type Required Description Restrictions
black_list AccountNotificationsBlacklist none none
settings AccountNotificationsSettings * Account notification settings none

AccountNotificationsBlacklist

{
  "uids": [
    "string"
  ]
}

Properties

Name Type Required Description Restrictions
uids [string] * none none

AccountNotificationsEmailSettings

{
  "addresses": [
    "string"
  ],
  "attachments": {
    "confirmation_page": true,
    "receive_fax": true,
    "send_fax": true
  },
  "low_credit": true,
  "new_feature": true,
  "receive_fax": true,
  "send_fax": true,
  "voicemail": true
}

Email notification settings

Properties

Name Type Required Description Restrictions
addresses [string] List of email addresses to send notifications to none
attachments object Email attachments settings none
» confirmation_page boolean none none
» receive_fax boolean * Set to true if you want to receive new faxes as notification attachments none
» send_fax boolean * Set to true if you want to receive your sent fax as an attachment to the notification none
low_credit boolean * Set to true if you want to receive notifications when your balance is low none
new_feature boolean * Set to true if you want to receive notifications about our new features none
receive_fax boolean * Set to true if you want to receive notifications about receiving faxes none
send_fax boolean * Set to true if you want to receive notifications when your fax is being send none
voicemail boolean * Set to true if you want to receive new voicemail notifications none

AccountNotificationsLanguage

Notifications language

Enum values

AccountNotificationsPushSettings

{
  "low_credit": true,
  "new_feature": true,
  "receive_fax": true,
  "send_fax": true,
  "voicemail": true
}

Push notification settings

Properties

Name Type Required Description Restrictions
low_credit boolean * Set to true if you want to receive notifications when your balance is low none
new_feature boolean * Set to true if you want to receive notifications about our new features none
receive_fax boolean * Set to true if you want to receive notifications about receiving faxes none
send_fax boolean * Set to true if you want to receive notifications when your fax is being send none
voicemail boolean * Set to true if you want to receive new voicemail notifications none

AccountNotificationsSettings

{
  "email": {
    "addresses": [
      "string"
    ],
    "attachments": {
      "confirmation_page": true,
      "receive_fax": true,
      "send_fax": true
    },
    "low_credit": true,
    "new_feature": true,
    "receive_fax": true,
    "send_fax": true,
    "voicemail": true
  },
  "language": "en",
  "push_notifications": {
    "low_credit": true,
    "new_feature": true,
    "receive_fax": true,
    "send_fax": true,
    "voicemail": true
  },
  "slack": {
    "receive_fax": "with_attachment",
    "send_fax": "with_attachment",
    "target_channel": "string"
  },
  "sms": {
    "low_credit": true,
    "new_feature": true,
    "numbers": [
      "string"
    ],
    "receive_fax": true,
    "send_fax": true,
    "voicemail": true
  }
}

Account notification settings

Properties

Name Type Required Description Restrictions
email AccountNotificationsEmailSettings * Email notification settings none
language AccountNotificationsLanguage Notifications language none
push_notifications AccountNotificationsPushSettings * Push notification settings none
slack AccountNotificationsSlackSettings Slack notification settings none
sms AccountNotificationsSmsSettings * SMS notification settings none

AccountNotificationsSlackSettings

{
  "receive_fax": "with_attachment",
  "send_fax": "with_attachment",
  "target_channel": "string"
}

Slack notification settings

Properties

Name Type Required Description Restrictions
receive_fax SlackNotificationMode * none none
send_fax SlackNotificationMode * none none
target_channel string * Channel to send notifications none

AccountNotificationsSmsSettings

{
  "low_credit": true,
  "new_feature": true,
  "numbers": [
    "string"
  ],
  "receive_fax": true,
  "send_fax": true,
  "voicemail": true
}

SMS notification settings

Properties

Name Type Required Description Restrictions
low_credit boolean * Set to true if you want to receive notifications when your balance is low none
new_feature boolean * Set to true if you want to receive notifications about our new features none
numbers [string] List of phone numbers to send SMS notifications to none
receive_fax boolean * Set to true if you want to receive notifications about receiving faxes none
send_fax boolean * Set to true if you want to receive notifications when your fax is being send none
voicemail boolean * Set to true if you want to receive new voicemail notifications none

AccountStatus

Your account status which could be active, inactive etc

Enum values

AccountType

Account type which could be corporate_admin, individual, etc

Enum values

Binary

Binary data. Will save to file and return file path if _preload_content is True, otherwise will return binary stream

CoverPageFlags

Allowed flags for the cover page

Enum values

Error

{
  "description": "string",
  "error": "string"
}

Properties

Name Type Required Description Restrictions
description string none none
error string none none

Fax

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

Properties

Name Type Required Description Restrictions
comment string * Free-form comment none
cost integer Fax cost in the user currency none
cost_details object * none none
» multiplier number none none
» notification_cost number none none
description string none none
direction FaxDirection Fax direction none
duration integer none none
file string Fax file ID for the getFile handle none
file_name string Human-readable file name none
from string Sender number. Might be a userId for faxes sent or received with free accounts none
header string none none
id string * Fax ID none
is_read boolean none none
is_spam boolean True if the fax is marked as spam none
last_update string none none
max_retry integer Maximum number of retries none
owner_id string * User ID of the fax owner none
pages integer * Number of pages in the fax none
retry_delay integer Delay between two retries none
scheduled_time string none none
start_time string Time at which faxing session started. Format: YYYY-MM-DD HH:mm:ss none
status FaxStatus * Fax status none
submit_time string Time when the fax was submitted for sending. For outgoing faxes only none
to string Fax destination number. Might be a userId for faxes sent or received with free accounts none
cover_page FaxCoverPage Fax cover page none

FaxCoverPage

{
  "name_to": "string",
  "name_from": "string",
  "subject": "string",
  "flags": [
    "urgent"
  ],
  "message": "string"
}

Fax cover page

Properties

Name Type Required Description Restrictions
name_to string * TO field on the cover page none
name_from string * FROM field on the cover page none
subject string * SUBJECT field on the cover page none
flags [CoverPageFlags] Cover page flags none
message string MESSAGE field on the cover page none

FaxCategory

Enum values

FaxDirection

Fax direction

Enum values

FaxList

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

List of fax data

Properties

Name Type Required Description Restrictions
data FaxListData none none

FaxListData

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

Properties

Name Type Required Description Restrictions
records [Fax] none none

FaxStatus

Fax status

Enum values

File

{
  "fax_file": "fax.pdf"
}

File to be uploaded

Properties

Name Type Required Description Restrictions
fax_file string(binary) * Path to file to upload none

FilePath

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

File path object

Properties

Name Type Required Description Restrictions
path string * Path of newly uploaded file none

FileType

File type

Enum values

MemberDetail

{
  "quota": 400,
  "role": "Sales Manager"
}

Company member details

Properties

Name Type Required Description Restrictions
quota integer Quota of member (number of pages member can send per month) none
role string Role of member in your company none

Number

{
  "acquired_date": "2017-07-31 09:20:06",
  "assigned_to": [
    "7724157c0974440293e45877c57f0703"
  ],
  "expiration_date": null,
  "id": "e6e68ef87f0b8768ebacdb218994bfe7",
  "is_canceled": false,
  "notifications": [
    {
      "email": true,
      "push_notification": true,
      "type": "voicemail"
    },
    {
      "email": true,
      "push_notification": true,
      "type": "receive_fax"
    },
    {
      "email": true,
      "push_notification": true,
      "type": "announcement"
    },
    {
      "email": true,
      "push_notification": true,
      "type": "callforward"
    }
  ],
  "number": "+16699990000",
  "owner_id": "7724157c0974440293e45877c57f0703",
  "status": "active"
}

Properties

Name Type Required Description Restrictions
acquired_date string * Date and time at which the number was acquired none
assigned_to [string] * IDs of the user to whom this number is assigned none
expiration_date string Number expiration date, might be blank none
id string * Number ID none
is_canceled boolean True if number is canceled but not yet deleted none
notifications [any] none none
» email boolean none none
» push_notification boolean none none
» type string none none
number string * Fax number Pattern: ^[+][0-9]{8,}$
owner_id string * Number owner ID none
status NumberStatus * Status of your fax number e.g. active, inactive. none

NumberStatus

Status of your fax number e.g. active, inactive.

Enum values

NumberList

{
  "numbers": [
    {
      "acquired_date": "2017-07-31 09:20:06",
      "assigned_to": [
        "7724157c0974440293e45877c57f0703"
      ],
      "expiration_date": null,
      "id": "e6e68ef87f0b8768ebacdb218994bfe7",
      "is_canceled": false,
      "notifications": [
        {
          "email": true,
          "push_notification": true,
          "type": "voicemail"
        },
        {
          "email": true,
          "push_notification": true,
          "type": "receive_fax"
        },
        {
          "email": true,
          "push_notification": true,
          "type": "announcement"
        },
        {
          "email": true,
          "push_notification": true,
          "type": "callforward"
        }
      ],
      "number": "+16699990000",
      "owner_id": "7724157c0974440293e45877c57f0703",
      "status": "active"
    }
  ]
}

List of numbers

Properties

Name Type Required Description Restrictions
numbers [Number] * none none

Outbox

{
  "comment": {
    "tags": [],
    "text": ""
  },
  "contact_name": "",
  "designated_src": "",
  "extra_info": {},
  "file_changes": [],
  "files": [
    "/transient-29362c0c-eeff-45c1-9f4e-4ef5865a41df"
  ],
  "id": "13a4afb0585345639733857e8f36df8d",
  "initiated_from": {
    "from_id": "",
    "type": ""
  },
  "ip": "8.8.8.8",
  "last_updated_status_time": "2017-09-24 06:43:04",
  "options": {},
  "page_count": 0,
  "retry": {
    "count": 0,
    "delay": 0
  },
  "send_time": "2017-09-24 06:43:04 +0000",
  "should_enhance": false,
  "src": "+16699990000",
  "status": "submitted",
  "status_changes": [
    {
      "at": "2017-09-24 06:43:04",
      "status": "submitted"
    }
  ],
  "submit_time": "2017-09-24 06:43:04 +0000",
  "to": [
    "+16699990000"
  ],
  "uid": "53a1afb8585345a39033857e1f36bf8d"
}

Model for the outbound fax stored in the outbox

Properties

Name Type Required Description Restrictions
comment OutboxComment Comment to set for the fax job none
contact_name string none none
designated_src string none none
extra_info object none none
file_changes [any] none none
» at string none none
» files [any] none none
»» file_name string none none
»» mime_type string none none
»» size number none none
files [string] Files to send none
id string * Fax ID none
initiated_from object none none
» from_id string none none
» type string none none
ip string IP address from which the send request originated none
last_updated_status_time string Time and date when the send request status was last updated. Format: YYYY-MM-DD HH:mm:ss Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}
options OutboxOptions Additional configuration for sending a fax none
page_count integer Number of fax pages none
retry RetryOptions Fax retry settings none
send_time string none none
should_enhance boolean none none
src string none none
status OutboxStatus * Outbound fax status none
status_changes [any] none none
» at string * Date and time at which status changed. Format: YYYY-MM-DD HH:mm:ss none
» status OutboxStatus * Outbound fax status none
submit_time string Date and time when the fax was submitted for sending none
to [string] none none
uid string * User ID none
cover_page OutboxCoverPage Fax cover page none

OutboxOptions

{
  "enhancement": true,
  "retry": {
    "retry": {
      "count": 2,
      "delay": 10
    }
  }
}

Additional configuration for sending a fax

Properties

Name Type Required Description Restrictions
enhancement boolean Text enhancement. Set to True to optimize fax file for text. none
retry RetryOptions Fax retry settings none

OutboxComment

{
  "tags": [],
  "text": ""
}

Comment to set for the fax job

Properties

Name Type Required Description Restrictions
tags [string] none none
text string none none

OutboxCoverPage

{
  "name_to": "string",
  "name_from": "string",
  "subject": "string",
  "flags": [
    "urgent"
  ],
  "message": "string"
}

Fax cover page

Properties

Name Type Required Description Restrictions
name_to string * TO field on the cover page none
name_from string * FROM field on the cover page none
subject string * SUBJECT field on the cover page none
flags [CoverPageFlags] Cover page flags none
message string MESSAGE field on the cover page none

OutboxStatus

Outbound fax status

Enum values

OutboxList

{
  "records": [
    {
      "comment": {
        "tags": [],
        "text": ""
      },
      "contact_name": "",
      "designated_src": "",
      "extra_info": {},
      "file_changes": [],
      "files": [
        "/transient-29362c0c-eeff-45c1-9f4e-4ef5865a41df"
      ],
      "id": "13a4afb0585345639733857e8f36df8d",
      "initiated_from": {
        "from_id": "",
        "type": ""
      },
      "ip": "8.8.8.8",
      "last_updated_status_time": "2017-09-24 06:43:04",
      "options": {},
      "page_count": 0,
      "retry": {
        "count": 0,
        "delay": 0
      },
      "send_time": "2017-09-24 06:43:04 +0000",
      "should_enhance": false,
      "src": "+16699990000",
      "status": "submitted",
      "status_changes": [
        {
          "at": "2017-09-24 06:43:04",
          "status": "submitted"
        }
      ],
      "submit_time": "2017-09-24 06:43:04 +0000",
      "to": [
        "+16699990000"
      ],
      "uid": "53a1afb8585345a39033857e1f36bf8d"
    }
  ]
}

List of the outgoing faxes

Properties

Name Type Required Description Restrictions
records [Outbox] * [Model for the outbound fax stored in the outbox] none

PayloadAccountModification

{
  "account_data": {
    "default_file_type": "pdf",
    "save_history": true
  },
  "email": "[email protected]",
  "name": "John",
  "lastname": "Smith",
  "notifications": {
    "black_list": {
      "uids": []
    },
    "settings": {
      "email": {
        "addresses": [
          "[email protected]"
        ],
        "low_credit": true,
        "new_feature": true,
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      },
      "language": "en",
      "push_notifications": {
        "low_credit": true,
        "new_feature": true,
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      },
      "sms": {
        "low_credit": true,
        "new_feature": true,
        "numbers": [
          "+16699990000"
        ],
        "receive_fax": true,
        "send_fax": true,
        "voicemail": true
      }
    }
  },
  "phone": "+16699990000",
  "settings": {
    "caller_id_name": "Fax.Plus",
    "send_fax": {
      "options": {},
      "retry": {
        "count": 0,
        "delay": 0
      },
      "should_enhance": true
    }
  }
}

Model for updating user account

Properties

Name Type Required Description Restrictions
account_data AccountData none none
email string Account email address Pattern: ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$
lastname string Your last name none
name string Your first name none
notifications AccountNotifications Account notification settings none
phone string Your account phone number Pattern: ^[+]?[0-9]{8,}$
profile_image string Profile image path none
settings AccountSettings Account settings none

PayloadFaxModification

{
  "comment": "string",
  "is_read": true
}

Properties

Name Type Required Description Restrictions
comment string * none none
is_read boolean * none none

PayloadNumberModification

{
  "assigned_to": "string"
}

Number update model

Properties

Name Type Required Description Restrictions
assigned_to string * User ID of the account to assign number to none

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
}

Model for creating new outbound fax

Properties

Name Type Required Description Restrictions
from string * Number to use for sending the fax Pattern: ^([+][0-9]{8,}([*]{0,10}[0-9]+)?)&#124;(no_number)&#124;(NO_NUMBER)$
to [string] * List of fax destination numbers none
files [string] * List of file names to send. Files should be uploaded beforehand. none
comment OutboxComment Comment to set for the fax job none
options OutboxOptions Additional configuration for sending a fax none
send_time string Date when to send the fax. Format: YYYY-MM-DD HH:mm:ss +HHMM Pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} [+][0-9]{4}
return_ids boolean Return scheduled fax IDs to use for tracking and with webhooks none
cover_page OutboxCoverPage Fax cover page none

PayloadOutboxModification

{
  "comment": "string"
}

Model for updating the outgoing fax

Properties

Name Type Required Description Restrictions
comment string New comment text none

RetryOptions

{
  "retry": {
    "count": 2,
    "delay": 10
  }
}

Fax retry settings

Properties

Name Type Required Description Restrictions
count integer Number of tries to send the fax none
delay integer Delay in seconds between two retries none

SendFaxResponse

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

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

Properties

Name Type Required Description Restrictions
ids object Destination-to-ID mapping none

SlackNotificationMode

Enum values

Webhook

{
  "target": "http://myapp.com/fax_received",
  "event": "fax_received"
}

Webhook model

Properties

Name Type Required Description Restrictions
id string Webhook ID none
target string * Webhook target URL none
event WebhookEventType * Webhook event type none

WebhookId

{
  "id": "6048b47181dbe1a7d67fcc98"
}

Webhook ID

Properties

Name Type Required Description Restrictions
id string * Webhook ID none

WebhookEventType

Webhook event type

Enum values

WebhookList

{
  "data": [
    {
      "target": "http://myapp.com/fax_received",
      "event": "fax_received"
    }
  ]
}

List of webhooks

Properties

Name Type Required Description Restrictions
data [Webhook] [Webhook model] none

WebhookCallback

{
  "hook": {
    "id": "604f440d1e9bdd19711ab7f9",
    "event": "fax_received",
    "event_time": "2021-03-15 00:00:00",
    "target": "http://mywebsite.com"
  },
  "data": {
    "id": "604f440d1e9bdd19711ab7f9",
    "pages": 1,
    "from": "+1 123-456-1234",
    "to": "+14564321234",
    "start_time": "2021-03-15 00:00:00",
    "file": "e6bccef681aa4143a393c871a4061e16.pdf",
    "file_name": "fax-from-18304838134"
  }
}

Webhook callback example

Properties

Name Type Required Description Restrictions
hook object Hook and event description none
» id string Fax ID none
» event string Event type none
» event_time string Time of the event. Format: YYYY-MM-DD HH:mm:ss none
» target string Configured URL target for this webhook none
data object Callback data, depends on the event type none
» id string Fax session ID. Note that this ID might be different from the one returned by the listFaxes handle, as this ID refers to the faxing session as a whole, with retries included. Both IDs can be used with the API getFile handle none
» uid string Sender user ID none
» pages number Number of pages in the fax none
» from_number string Sender number. Might be a user ID for faxes sent from free accounts none
» to_number string Fax destination number. Might be a user ID for faxes sent from free accounts none
» start_time string Time at which faxing session started. Format: YYYY-MM-DD HH:mm:ss none
» file string File ID none
» file_name string Human-readable file name none
» cost number Fax cost (in pages) none
» status FaxStatus Fax status none

Enumerated Values

Property Value
event fax_sent
event fax_received