const axios = require('axios');
const ContactsApiFp = require('@alohi/faxplus-api').ContactsApiFp;
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 createContact() {
const contactData = {
name: 'John Doe',
fax_number: '+12025551234',
email: 'john@example.com',
notes: 'Important client'
};
const req = await ContactsApiFp(config).createContact({
userId: 'self',
body: contactData
});
const resp = await req(axios);
}
createContact()
from faxplus import ApiClient, ContactsApi
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 = ContactsApi(api_client)
contact_data = {
'name': 'John Doe',
'fax_number': '+12025551234',
'email': 'john@example.com',
'notes': 'Important client'
}
resp = api.create_contact(user_id='self', body=contact_data)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
String url = "https://restapi.fax.plus/v3/accounts/self/contacts";
String jsonBody = "{\"name\":\"John Doe\",\"fax_number\":\"+12025551234\",\"email\":\"john@example.com\",\"notes\":\"Important client\"}";
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, ContentType.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"}
}
jsonBody := []byte(`{"name":"John Doe","fax_number":"+12025551234","email":"john@example.com","notes":"Important client"}`)
data := bytes.NewBuffer(jsonBody)
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/self/contacts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'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();
$body = array(
'name' => 'John Doe',
'fax_number' => '+12025551234',
'email' => 'john@example.com',
'notes' => 'Important client'
);
try {
$response = $client->request('POST','https://restapi.fax.plus/v3/accounts/self/contacts', array(
'headers' => $headers,
'json' => $body,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
curl -X POST https://restapi.fax.plus/v3/accounts/self/contacts \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: "YOUR_CLIENT_ID"' \
-d '{
"name": "John Doe",
"fax_number": "+12025551234",
"email": "john@example.com",
"notes": "Important client"
}'
{}{
"error": "invalid_user_id",
"description": "Invalid user id given"
}{
"error": "unauthorized",
"description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."
}{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}Create a contact
Create a new contact (Permitted scopes: fax:all:edit)
const axios = require('axios');
const ContactsApiFp = require('@alohi/faxplus-api').ContactsApiFp;
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 createContact() {
const contactData = {
name: 'John Doe',
fax_number: '+12025551234',
email: 'john@example.com',
notes: 'Important client'
};
const req = await ContactsApiFp(config).createContact({
userId: 'self',
body: contactData
});
const resp = await req(axios);
}
createContact()
from faxplus import ApiClient, ContactsApi
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 = ContactsApi(api_client)
contact_data = {
'name': 'John Doe',
'fax_number': '+12025551234',
'email': 'john@example.com',
'notes': 'Important client'
}
resp = api.create_contact(user_id='self', body=contact_data)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
String url = "https://restapi.fax.plus/v3/accounts/self/contacts";
String jsonBody = "{\"name\":\"John Doe\",\"fax_number\":\"+12025551234\",\"email\":\"john@example.com\",\"notes\":\"Important client\"}";
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, ContentType.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"}
}
jsonBody := []byte(`{"name":"John Doe","fax_number":"+12025551234","email":"john@example.com","notes":"Important client"}`)
data := bytes.NewBuffer(jsonBody)
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/self/contacts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'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();
$body = array(
'name' => 'John Doe',
'fax_number' => '+12025551234',
'email' => 'john@example.com',
'notes' => 'Important client'
);
try {
$response = $client->request('POST','https://restapi.fax.plus/v3/accounts/self/contacts', array(
'headers' => $headers,
'json' => $body,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
curl -X POST https://restapi.fax.plus/v3/accounts/self/contacts \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: "YOUR_CLIENT_ID"' \
-d '{
"name": "John Doe",
"fax_number": "+12025551234",
"email": "john@example.com",
"notes": "Important client"
}'
{}{
"error": "invalid_user_id",
"description": "Invalid user id given"
}{
"error": "unauthorized",
"description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."
}{
"error": "internal_server_error",
"description": "An unexpected error happened, please contact support"
}const axios = require('axios');
const ContactsApiFp = require('@alohi/faxplus-api').ContactsApiFp;
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 createContact() {
const contactData = {
name: 'John Doe',
fax_number: '+12025551234',
email: 'john@example.com',
notes: 'Important client'
};
const req = await ContactsApiFp(config).createContact({
userId: 'self',
body: contactData
});
const resp = await req(axios);
}
createContact()
from faxplus import ApiClient, ContactsApi
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 = ContactsApi(api_client)
contact_data = {
'name': 'John Doe',
'fax_number': '+12025551234',
'email': 'john@example.com',
'notes': 'Important client'
}
resp = api.create_contact(user_id='self', body=contact_data)
/**
* Example below uses Apache HTTP Client 4 with Fluent API
**/
String url = "https://restapi.fax.plus/v3/accounts/self/contacts";
String jsonBody = "{\"name\":\"John Doe\",\"fax_number\":\"+12025551234\",\"email\":\"john@example.com\",\"notes\":\"Important client\"}";
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, ContentType.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"}
}
jsonBody := []byte(`{"name":"John Doe","fax_number":"+12025551234","email":"john@example.com","notes":"Important client"}`)
data := bytes.NewBuffer(jsonBody)
req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/self/contacts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'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();
$body = array(
'name' => 'John Doe',
'fax_number' => '+12025551234',
'email' => 'john@example.com',
'notes' => 'Important client'
);
try {
$response = $client->request('POST','https://restapi.fax.plus/v3/accounts/self/contacts', array(
'headers' => $headers,
'json' => $body,
)
);
print_r($response->getBody()->getContents());
}
catch (GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
curl -X POST https://restapi.fax.plus/v3/accounts/self/contacts \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}' \
-H 'x-fax-clientid: "YOUR_CLIENT_ID"' \
-d '{
"name": "John Doe",
"fax_number": "+12025551234",
"email": "john@example.com",
"notes": "Important client"
}'
Authorizations
Personal Access Token (PAT) is a Bearer token used for secure API calls. For direct API calls, the PAT is used in the Authorization header as 'Bearer {PAT}'. For MCP usage, configure your PAT in your MCP client settings (e.g., in your IDE's MCP server configuration) - authentication will be handled automatically.
Body
Contact name
100"John Doe"
Contact's fax number
2 - 20^\+[0-9]{1,15}$"+12025551234"
Contact's email address
100^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$"john.doe@example.com"
Contact's cellphone number
20^$|^[+]?[0-9]*$"+12025551235"
Contact's phone number
20^$|^[+]?[0-9]*$"+12025551236"
Additional notes
1000"Prefers email communication"
List of group names
50100["sales", "department 001"]
Whether this contact has a human fax operator. When enabled, an IVR will ask the operator to switch to fax mode
false
Whether to share contact with corporate members
false
Response
Contact created successfully